~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Jelmer Vernooij
  • Date: 2012-06-18 11:43:07 UTC
  • mfrom: (6437.54.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6525.
  • Revision ID: jelmer@samba.org-20120618114307-zeazlym311p38m98
MergeĀ 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
 
137
137
    :param base: plugins can specify their own local directory
138
138
    """
139
 
    if hasattr(sys, 'frozen'):
 
139
    fs_enc = sys.getfilesystemencoding()
 
140
    if getattr(sys, 'frozen', False):
140
141
        if base is None:
141
 
            base = os.path.dirname(
142
 
                unicode(sys.executable, sys.getfilesystemencoding()))
 
142
            base = os.path.dirname(unicode(sys.executable, fs_enc))
143
143
        return os.path.join(base, u'locale')
144
144
    else:
145
145
        if base is None:
146
 
            base = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
 
146
            base = os.path.dirname(unicode(__file__, fs_enc))
147
147
        dirpath = os.path.realpath(os.path.join(base, u'locale'))
148
148
        if os.path.exists(dirpath):
149
149
            return dirpath
150
 
        else:
151
 
            return '/usr/share/locale'
 
150
    return os.path.join(unicode(sys.prefix, fs_enc), u"share", u"locale")
152
151
 
153
152
 
154
153
def _check_win32_locale():