Commit 788ed13b by Calen Pennington

Rename djangojs.po to djangojs-partial.po in transifex, to prevent header creep

parent 4e879a4c
......@@ -13,9 +13,9 @@ source_file = conf/locale/en/LC_MESSAGES/django-studio.po
source_lang = en
type = PO
[edx-platform.djangojs]
file_filter = conf/locale/<lang>/LC_MESSAGES/djangojs.po
source_file = conf/locale/en/LC_MESSAGES/djangojs.po
[edx-platform.djangojs-partial]
file_filter = conf/locale/<lang>/LC_MESSAGES/djangojs-partial.po
source_file = conf/locale/en/LC_MESSAGES/djangojs-partial.po
source_lang = en
type = PO
......
......@@ -53,7 +53,7 @@ segment:
django-studio.po: # produces this .po file..
- cms/* # by segregating strings from these files.
# Anything that doesn't match a pattern stays in the original file.
djangojs.po:
djangojs-partial.po:
djangojs-studio.po:
- cms/*
mako.po:
......@@ -69,5 +69,5 @@ generate_merge:
- mako-studio.po
- messages.po
djangojs.po:
- djangojs.po
- djangojs-partial.po
- djangojs-studio.po
......@@ -6,7 +6,7 @@ See https://edx-wiki.atlassian.net/wiki/display/ENG/PO+File+workflow
This task extracts all English strings from all source code
and produces three human-readable files:
conf/locale/en/LC_MESSAGES/django-partial.po
conf/locale/en/LC_MESSAGES/djangojs.po
conf/locale/en/LC_MESSAGES/djangojs-partial.po
conf/locale/en/LC_MESSAGES/mako.po
This task will clobber any existing django.po file.
......@@ -42,15 +42,15 @@ def main():
source_msgs_dir = CONFIGURATION.source_messages_dir
remove_file(source_msgs_dir.joinpath('django.po'))
# Extract strings from mako templates.
babel_mako_cmd = 'pybabel extract -F %s -c "Translators:" . -o %s' % (BABEL_CONFIG, BABEL_OUT)
execute(babel_mako_cmd, working_directory=BASE_DIR)
makemessages = "django-admin.py makemessages -l en"
ignores = " ".join('--ignore="{}/*"'.format(d) for d in CONFIGURATION.ignore_dirs)
if ignores:
makemessages += " " + ignores
# Extract strings from mako templates.
babel_mako_cmd = 'pybabel extract -F %s -c "Translators:" . -o %s' % (BABEL_CONFIG, BABEL_OUT)
execute(babel_mako_cmd, working_directory=BASE_DIR)
# Extract strings from django source files, including .py files.
make_django_cmd = makemessages + ' --extension html'
execute(make_django_cmd, working_directory=BASE_DIR)
......@@ -66,6 +66,13 @@ def main():
source_msgs_dir.joinpath('django-partial.po')
)
# makemessages creates 'djangojs.po'. This filename is hardcoded.
# Rename it to djangojs-partial.po to enable merging into djangojs.po later.
os.rename(
source_msgs_dir.joinpath('djangojs.po'),
source_msgs_dir.joinpath('djangojs-partial.po')
)
# Segment the generated files.
segmented_files = segment_pofiles("en")
......
......@@ -17,7 +17,7 @@ class TestExtract(TestCase):
"""
Tests functionality of i18n/extract.py
"""
generated_files = ('django-partial.po', 'djangojs.po', 'mako.po')
generated_files = ('django-partial.po', 'djangojs-partial.po', 'mako.po')
def setUp(self):
# Skip this test because it takes too long (>1 minute)
......
......@@ -16,7 +16,7 @@ class TestGenerate(TestCase):
"""
Tests functionality of i18n/generate.py
"""
generated_files = ('django-partial.po', 'djangojs.po', 'mako.po')
generated_files = ('django-partial.po', 'djangojs-partial.po', 'mako.po')
def setUp(self):
# Subtract 1 second to help comparisons with file-modify time succeed,
......
......@@ -37,7 +37,7 @@ def clean_locale(locale):
Iterates over machine-generated files.
"""
dirname = CONFIGURATION.get_messages_dir(locale)
for filename in ('django-partial.po', 'djangojs.po', 'mako.po'):
for filename in ('django-partial.po', 'djangojs-partial.po', 'mako.po'):
clean_file(dirname.joinpath(filename))
def clean_file(file):
......
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