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