From 2b463a201336d7b14dea564e30d0a2af7ae9aa0b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 26 Jun 2007 08:43:49 +0000 Subject: Merge new translations when updating the .pot. --- 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) -- cgit v0.9.1