diff --git a/conf/locale/config.yaml b/conf/locale/config.yaml index 954966ef3e..aeb281103f 100644 --- a/conf/locale/config.yaml +++ b/conf/locale/config.yaml @@ -32,6 +32,15 @@ locales: # The locale used for fake-accented English, for testing. dummy-locale: eo +# Directories we don't search for strings. +ignore_dirs: + - docs + - src + - i18n + - test_root + - common/static/xmodule/modules + - common/static/xmodule/descriptors + # How should .po files be segmented? See i18n/segment.py for details. Strings # that are only found in a particular segment are segregated into that .po file # so that translators can focus on separate parts of the product. diff --git a/i18n/extract.py b/i18n/extract.py index 1d7fa7ea5f..2bada77aab 100755 --- a/i18n/extract.py +++ b/i18n/extract.py @@ -40,15 +40,13 @@ def main(): create_dir_if_necessary(LOCALE_DIR) source_msgs_dir = CONFIGURATION.source_messages_dir - remove_file(source_msgs_dir.joinpath('django.po')) - generated_files = ('django-partial.po', 'djangojs.po', 'mako.po') - for filename in generated_files: - remove_file(source_msgs_dir.joinpath(filename)) + generated_files = ['django-partial.po', 'djangojs.po', 'mako.po'] # Prepare makemessages command. - ignore_dirs = ["docs", "src", "i18n", "test_root"] - ignores = " ".join("--ignore={}/*".format(d) for d in ignore_dirs) - makemessages = 'django-admin.py makemessages -l en ' + ignores + 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) @@ -80,6 +78,7 @@ def main(): strip_key_strings(po) po.save() + def fix_header(po): """ Replace default headers with edX headers