~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Patch Queue Manager
  • Date: 2012-06-18 12:59:19 UTC
  • mfrom: (6524.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20120618125919-jf2dy5p1apoljtan
(jelmer) Merge 2.5. (Jelmer Vernooij)

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