Commit 12d8df97 by louyihua

Babel underscore extraction update according to @nedbat

1. Add underscore.po into the merge section in config.yaml
2. Using one babel command template to construct two babel commands
parent fa0dee17
......@@ -108,6 +108,9 @@ segment:
mako.po:
mako-studio.po:
- cms/*
underscore.po:
underscore-studio.po:
- cms/*
# How should the generate step merge files?
generate_merge:
......@@ -122,3 +125,4 @@ generate_merge:
- djangojs-partial.po
- djangojs-studio.po
- underscore.po
- underscore-studio.po
......@@ -63,16 +63,16 @@ def main(verbosity=1):
else:
stderr = DEVNULL
babel_mako_cmd = 'pybabel {verbosity} extract -F {config} -c "Translators:" . -o {output}'
babel_mako_cmd = babel_mako_cmd.format(
babel_cmd_template = 'pybabel {verbosity} extract -F {config} -c "Translators:" . -o {output}'
babel_mako_cmd = babel_cmd_template.format(
verbosity=babel_verbosity,
config=base(LOCALE_DIR, 'babel_mako.cfg'),
output=base(CONFIGURATION.source_messages_dir, 'mako.po'),
)
execute(babel_mako_cmd, working_directory=BASE_DIR, stderr=stderr)
babel_underscore_cmd = 'pybabel {verbosity} extract -F {config} -c "Translators:" . -o {output}'
babel_underscore_cmd = babel_underscore_cmd.format(
babel_underscore_cmd = babel_cmd_template.format(
verbosity=babel_verbosity,
config=base(LOCALE_DIR, 'babel_underscore.cfg'),
output=base(CONFIGURATION.source_messages_dir, 'underscore.po'),
......@@ -108,8 +108,6 @@ def main(verbosity=1):
files_to_clean = set()
files_to_clean.add(source_msgs_dir / "underscore.po")
# Extract strings from third-party applications.
for app_name in CONFIGURATION.third_party:
# Import the app to find out where it is. Then use pybabel to extract
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment