Rev 6496: (gz) Use sys.prefix not /usr when looking for installed .mo files (Martin in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

Patch Queue Manager pqm at pqm.ubuntu.com
Mon Apr 30 09:27:59 UTC 2012


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.5/

------------------------------------------------------------
revno: 6496 [merge]
revision-id: pqm at pqm.ubuntu.com-20120430092759-upfwbgheb2udt89w
parent: pqm at pqm.ubuntu.com-20120430090202-5urvt0x32da93go9
parent: martin.packman at canonical.com-20120327173219-401pil42gke8j0xh
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.5
timestamp: Mon 2012-04-30 09:27:59 +0000
message:
  (gz) Use sys.prefix not /usr when looking for installed .mo files (Martin
   Packman)
modified:
  bzrlib/i18n.py                 i18n.py-20110429130428-eblvodng604h3dzi-1
=== modified file 'bzrlib/i18n.py'
--- a/bzrlib/i18n.py	2011-12-19 13:23:58 +0000
+++ b/bzrlib/i18n.py	2012-03-27 17:32:19 +0000
@@ -136,19 +136,18 @@
 
     :param base: plugins can specify their own local directory
     """
-    if hasattr(sys, 'frozen'):
+    fs_enc = sys.getfilesystemencoding()
+    if getattr(sys, 'frozen', False):
         if base is None:
-            base = os.path.dirname(
-                unicode(sys.executable, sys.getfilesystemencoding()))
+            base = os.path.dirname(unicode(sys.executable, fs_enc))
         return os.path.join(base, u'locale')
     else:
         if base is None:
-            base = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
+            base = os.path.dirname(unicode(__file__, fs_enc))
         dirpath = os.path.realpath(os.path.join(base, u'locale'))
         if os.path.exists(dirpath):
             return dirpath
-        else:
-            return '/usr/share/locale'
+    return os.path.join(unicode(sys.prefix, fs_enc), u"share", u"locale")
 
 
 def _check_win32_locale():




More information about the bazaar-commits mailing list