~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/i18n.py

  • Committer: Martin Packman
  • Date: 2012-03-27 17:32:19 UTC
  • mto: (6437.54.3 2.5)
  • mto: This revision was merged to the branch mainline in revision 6525.
  • Revision ID: martin.packman@canonical.com-20120327173219-401pil42gke8j0xh
Fall back to sys.prefix not /usr when looking for .mo files

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