~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:56:05 UTC
  • mfrom: (6615.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201195605-o7rl92wf6uyum3fk
(vila) Open trunk again as 2.8b1 (Vincent Ladeuil)

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():