Rev 6103: (jr) Install translation .mo files in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Aug 26 00:51:14 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6103 [merge]
revision-id: pqm at pqm.ubuntu.com-20110826005059-8nw3lheuht9xt8z7
parent: pqm at pqm.ubuntu.com-20110825210944-wg6d0tguv8beuvlf
parent: jriddell at canonical.com-20110825110237-h9pr1nyqbxofiaaf
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-08-26 00:50:59 +0000
message:
  (jr) Install translation .mo files
   (Jonathan Riddell)
modified:
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
  setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-08-25 21:09:44 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-08-26 00:50:59 +0000
@@ -109,6 +109,8 @@
 * Locations printed by ``bzr upgrade`` are now formatted before display.
   (Jelmer Vernooij)
 
+* Install translation .mo files. (Jonathan Riddell)
+
 Bug Fixes
 *********
 

=== modified file 'setup.py'
--- a/setup.py	2011-06-16 18:34:26 +0000
+++ b/setup.py	2011-08-25 11:02:37 +0000
@@ -10,6 +10,7 @@
 import os.path
 import sys
 import copy
+import glob
 
 if sys.version_info < (2, 6):
     sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
@@ -70,10 +71,13 @@
                                         'tests/ssl_certs/server_without_pass.key',
                                         'tests/ssl_certs/server_with_pass.key',
                                         'tests/ssl_certs/server.crt',
-                                        'locale/*/LC_MESSAGES/*.mo',
                                        ]},
            }
-
+I18N_FILES = []
+for filepath in glob.glob("bzrlib/locale/*/LC_MESSAGES/*.mo"):
+    langfile = filepath[len("bzrlib/locale/"):]
+    targetpath = os.path.dirname(os.path.join("share/locale", langfile))
+    I18N_FILES.append((targetpath, [filepath]))
 
 def get_bzrlib_packages():
     """Recurse through the bzrlib directory, and extract the package names"""
@@ -513,12 +517,12 @@
 
     ARGS.update(META_INFO)
     ARGS.update(BZRLIB)
+    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
     ARGS.update(PKG_DATA)
 
     setup(**ARGS)
 
 elif 'py2exe' in sys.argv:
-    import glob
     # py2exe setup
     import py2exe
 
@@ -668,7 +672,7 @@
                        'tools/win32/bzr_postinstall.py',
                        ]
     gui_targets = [gui_target]
-    data_files = topics_files + plugins_files
+    data_files = topics_files + plugins_files + I18N_FILES
 
     if 'qbzr' in plugins:
         get_qbzr_py2exe_info(includes, excludes, packages, data_files)
@@ -752,6 +756,7 @@
         # easy_install one
         DATA_FILES = [('man/man1', ['bzr.1'])]
 
+    DATA_FILES = DATA_FILES + I18N_FILES
     # std setup
     ARGS = {'scripts': ['bzr'],
             'data_files': DATA_FILES,




More information about the bazaar-commits mailing list