Commit c0470008 by Calen Pennington

Make i18n dummy dummy-ify all source english strings (rather than a static list)

parent 88789c1d
# Configuration for i18n workflow.
locales:
locales:
- en
# More languages we might want someday, these have started on Transifex.
......@@ -32,17 +32,6 @@ locales:
# The locale used for fake-accented English, for testing.
dummy-locale: eo
# Source files that should be used for generating dummy strings
dummy_sources:
- django-partial.po
- django-studio.po
- django.po
- djangojs-studio.po
- djangojs.po
- mako-studio.po
- mako.po
- messages.po
# Directories we don't search for strings.
ignore_dirs:
- docs
......
......@@ -22,7 +22,6 @@ class Configuration(object):
'locales': ['en'],
'segment': {},
'source_locale': 'en',
'dummy_sources': [],
}
def __init__(self, filename):
......
......@@ -6,8 +6,6 @@
# two letter language codes reference:
# see http://www.loc.gov/standards/iso639-2/php/code_list.php
#
# po files to turn into dummy strings are specified in configuration file
#
# Django will not localize in languages that django itself has not been
# localized for. So we are using a well-known language (default='eo').
# Django languages are listed in django.conf.global_settings.LANGUAGES
......@@ -19,10 +17,8 @@
#
# $ ./make_dummy.py
#
# generates output to
# CONFIGURATION.get_messages_dir(CONFIGURATION.dummy_locale)
# (for example,
# edx-platform/conf/locale/eo/LC_MESSAGES/)
# generates output conf/locale/$DUMMY_LOCALE/LC_MESSAGES,
# where $DUMMY_LOCALE is the dummy_locale value set in the i18n config
import os, sys
import polib
......@@ -63,8 +59,8 @@ def new_filename(original_filename, new_locale):
if __name__ == '__main__':
LOCALE = CONFIGURATION.dummy_locale
SOURCE_MSGS_DIR = CONFIGURATION.source_messages_dir
print "Processing source language files into dummy strings:",
for source_file in CONFIGURATION.dummy_sources:
print source_file,
print "Processing source language files into dummy strings:"
for source_file in CONFIGURATION.source_messages_dir.walkfiles('*.po'):
print ' ', source_file.relpath()
main(SOURCE_MSGS_DIR.joinpath(source_file), LOCALE)
print
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