Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/activity/bundlebuilder.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-05-25 19:51:14 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-05-25 19:51:14 (GMT)
commit211c5ae1c4a9825d8a4aaca6feb3920bc6ff73ff (patch)
treec989bc926a315fd574e01c559470490c68a12852 /src/sugar/activity/bundlebuilder.py
parent3313d78429dea74c81fef707b12b144414643e90 (diff)
Move genl10n inside the build step.
Diffstat (limited to 'src/sugar/activity/bundlebuilder.py')
-rw-r--r--src/sugar/activity/bundlebuilder.py50
1 files changed, 23 insertions, 27 deletions
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
index 487110b..cea6e20 100644
--- a/src/sugar/activity/bundlebuilder.py
+++ b/src/sugar/activity/bundlebuilder.py
@@ -94,12 +94,12 @@ class _AllFileList(list):
def cmd_help(config, options, args):
print 'Usage: \n\
+setup.py build - build generated files \n\
setup.py dev - setup for development \n\
setup.py dist - create a bundle package \n\
setup.py install [dirname] - install the bundle \n\
setup.py uninstall [dirname] - uninstall the bundle \n\
setup.py genpot - generate the gettext pot file \n\
-setup.py genl10n - generate localization files \n\
setup.py release - do a new release of the bundle \n\
setup.py help - print this message \n\
'
@@ -149,7 +149,7 @@ def _get_l10n_list(config):
return l10n_list
def cmd_dist(config, options, args):
- cmd_genl10n(config, options, args)
+ cmd_build(config, options, args)
file_list = _get_file_list(config.manifest)
@@ -221,30 +221,6 @@ def cmd_genpot(config, options, args):
if retcode:
print 'ERROR - xgettext failed with return code %i.' % retcode
-
-def cmd_genl10n(config, options, args):
- po_list = _get_po_list(config.manifest)
- for lang in po_list.keys():
- file_name = po_list[lang]
-
- localedir = os.path.join(config.source_dir, 'locale', lang)
- mo_path = os.path.join(localedir, 'LC_MESSAGES')
- if not os.path.isdir(mo_path):
- os.makedirs(mo_path)
-
- mo_file = os.path.join(mo_path, "%s.mo" % config.bundle_id)
- args = ["msgfmt", "--output-file=%s" % mo_file, file_name]
- retcode = subprocess.call(args)
- if retcode:
- print 'ERROR - msgfmt failed with return code %i.' % retcode
-
- cat = gettext.GNUTranslations(open(mo_file, 'r'))
- translated_name = cat.gettext(config.activity_name)
- linfo_file = os.path.join(localedir, 'activity.linfo')
- f = open(linfo_file, 'w')
- f.write('[Activity]\nname = %s\n' % translated_name)
- f.close()
-
def cmd_release(config, options, args):
if not os.path.isdir('.git'):
print 'ERROR - this command works only for git repositories'
@@ -327,7 +303,27 @@ def cmd_release(config, options, args):
print 'Done.'
def cmd_build(config, options, args):
- pass
+ po_list = _get_po_list(config.manifest)
+ for lang in po_list.keys():
+ file_name = po_list[lang]
+
+ localedir = os.path.join(config.source_dir, 'locale', lang)
+ mo_path = os.path.join(localedir, 'LC_MESSAGES')
+ if not os.path.isdir(mo_path):
+ os.makedirs(mo_path)
+
+ mo_file = os.path.join(mo_path, "%s.mo" % config.bundle_id)
+ args = ["msgfmt", "--output-file=%s" % mo_file, file_name]
+ retcode = subprocess.call(args)
+ if retcode:
+ print 'ERROR - msgfmt failed with return code %i.' % retcode
+
+ cat = gettext.GNUTranslations(open(mo_file, 'r'))
+ translated_name = cat.gettext(config.activity_name)
+ linfo_file = os.path.join(localedir, 'activity.linfo')
+ f = open(linfo_file, 'w')
+ f.write('[Activity]\nname = %s\n' % translated_name)
+ f.close()
def start(bundle_name, manifest='MANIFEST'):
parser = OptionParser()