Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-06-26 08:43:49 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-06-26 08:43:49 (GMT)
commit2b463a201336d7b14dea564e30d0a2af7ae9aa0b (patch)
tree23a87a3391fdcf5834e9c742ee5e732ea4fe8ee6
parentf85142bdc48a01d1de11a192143aaf48bf087dd0 (diff)
Merge new translations when updating the .pot.
-rw-r--r--sugar/activity/bundlebuilder.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/sugar/activity/bundlebuilder.py b/sugar/activity/bundlebuilder.py
index 05c5c65..54a6cee 100644
--- a/sugar/activity/bundlebuilder.py
+++ b/sugar/activity/bundlebuilder.py
@@ -190,20 +190,29 @@ def cmd_genpot(bundle_name, manifest):
for file_name in file_list:
if file_name.endswith('.py'):
python_files.append(file_name)
- service_name = Bundle(_get_source_path()).get_service_name()
- args = ["xgettext", "--language=Python", "--keyword=_",
- "--output=po/%s.pot" % bundle_name]
+
+ pot_file = os.path.join('po', '%s.pot' % bundle_name)
+ args = [ 'xgettext', '--language=Python',
+ '--keyword=_', '--output=%s' % pot_file ]
+
args += python_files
retcode = subprocess.call(args)
if retcode:
print 'ERROR - xgettext failed with return code %i.' % retcode
+ po_regex = re.compile("po/.*\.po$")
+ for file_name in _get_file_list(manifest):
+ if po_regex.match(file_name):
+ args = [ 'msgmerge', '-U', file_name, pot_file ]
+ retcode = subprocess.call(args)
+ if retcode:
+ print 'ERROR - msgmerge failed with return code %i.' % retcode
+
def cmd_genmo(bundle_name, manifest):
source_path = _get_source_path()
po_regex = re.compile("po/(.*)\.po$")
- file_list = _get_file_list(manifest)
- for file_name in file_list:
+ for file_name in _get_file_list(manifest):
match = po_regex.match(file_name)
if match:
lang = match.group(1)