diff --git a/.gitignore b/.gitignore index 46964cd2af106f282e79e9b5a080d4fef528819b..b3f7473dc0773c39d0312bb925c9a2b4e46eea16 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ cms/envs/private.py *.mo conf/locale/en/LC_MESSAGES/*.po !messages.po +### Remove when we have real Esperanto translations. For now, ignore +### dummy Esperanto files. +conf/locale/eo/* ### Testing artifacts .testids/ diff --git a/cms/djangoapps/contentstore/tests/test_i18n.py b/cms/djangoapps/contentstore/tests/test_i18n.py index c156f3f4cf43634d5c7f27b4559a7f194548bd66..c7e32a868945c62ee0a73d08bcd44065bf3cd7f8 100644 --- a/cms/djangoapps/contentstore/tests/test_i18n.py +++ b/cms/djangoapps/contentstore/tests/test_i18n.py @@ -73,8 +73,8 @@ class InternationalizationTest(ModuleStoreTestCase): # **** # # This test will break when we replace this fake 'test' language - # with actual French. This test will need to be updated with - # actual French at that time. + # with actual Esperanto. This test will need to be updated with + # actual Esperanto at that time. # Test temporarily disable since it depends on creation of dummy strings @skip def test_course_with_accents(self): @@ -82,10 +82,11 @@ class InternationalizationTest(ModuleStoreTestCase): self.client = AjaxEnabledTestClient() self.client.login(username=self.uname, password=self.password) - resp = self.client.get_html('/course', - {}, - HTTP_ACCEPT_LANGUAGE='fr' - ) + resp = self.client.get_html( + '/course', + {}, + HTTP_ACCEPT_LANGUAGE='eo' + ) TEST_STRING = ( u'<h1 class="title-1">' diff --git a/cms/envs/dev.py b/cms/envs/dev.py index 68712953564ce1b14273e131eae4e5d215957bf1..ea66688a8a01e705446f363dc9e7d0fd626da92d 100644 --- a/cms/envs/dev.py +++ b/cms/envs/dev.py @@ -12,7 +12,7 @@ DEBUG = True USE_I18N = True # For displaying the dummy text, we need to provide a language mapping. LANGUAGES = ( - ('fr', 'Francais'), + ('eo', 'Esperanto'), ) TEMPLATE_DEBUG = DEBUG LOGGING = get_logger_config(ENV_ROOT / "log", diff --git a/conf/locale/config b/conf/locale/config index 67252b1fa0df8189389a38596ba5671b37a93d20..8a2a31435dcb3f7f6ca5ca25ed218b30c5f21d3e 100644 --- a/conf/locale/config +++ b/conf/locale/config @@ -1,4 +1,4 @@ { "locales" : ["en"], - "dummy-locale" : "fr" + "dummy-locale" : "eo" } diff --git a/i18n/config.py b/i18n/config.py index 4f246ed942d406d5e6084aaa6b15aa60509ff37f..6f3e5d77737735e354a055856e4283fd80736e84 100644 --- a/i18n/config.py +++ b/i18n/config.py @@ -49,7 +49,7 @@ class Configuration: @property def dummy_locale(self): """ - Returns a locale to use for the dummy text, e.g. 'fr'. + Returns a locale to use for the dummy text, e.g. 'eo'. Throws exception if no dummy-locale is declared. The locale is a string. """ diff --git a/i18n/make_dummy.py b/i18n/make_dummy.py index 6c14edd45abd49e01fc4f7400c082e2eadfc2aa6..20eac03522a2168a314aebc93bc0c167758dd108 100755 --- a/i18n/make_dummy.py +++ b/i18n/make_dummy.py @@ -7,7 +7,8 @@ # see http://www.loc.gov/standards/iso639-2/php/code_list.php # # Django will not localize in languages that django itself has not been -# localized for. So we are using a well-known language (default='fr'). +# localized for. So we are using a well-known language (default='eo'). +# Django languages are listed in django.conf.global_settings.LANGUAGES # # po files can be generated with this: # django-admin.py makemessages --all --extension html -l en @@ -19,7 +20,7 @@ # $ ./make_dummy.py ../conf/locale/en/LC_MESSAGES/django.po # # generates output to -# mitx/conf/locale/fr/LC_MESSAGES/django.po +# mitx/conf/locale/eo/LC_MESSAGES/django.po import os, sys import polib diff --git a/i18n/tests/test_config.py b/i18n/tests/test_config.py index bcec6ac3545a006a08e23d948ba2dcabee6a1ca8..0ca94acdd1b8ee1b5bce640b8771d73298ec424a 100644 --- a/i18n/tests/test_config.py +++ b/i18n/tests/test_config.py @@ -29,5 +29,5 @@ class TestConfiguration(TestCase): self.assertIsNotNone(locales) self.assertIsInstance(locales, list) self.assertIn('en', locales) - self.assertEqual('fr', CONFIGURATION.dummy_locale) + self.assertEqual('eo', CONFIGURATION.dummy_locale) self.assertEqual('en', CONFIGURATION.source_locale) diff --git a/lms/envs/dev.py b/lms/envs/dev.py index 79891756fcbbd511316ab07c08076a1a83ed1bea..1fe7fc330ca1c797bbd03c17b58128e79127549b 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -19,7 +19,7 @@ DEBUG = True USE_I18N = True # For displaying the dummy text, we need to provide a language mapping. LANGUAGES = ( - ('fr', 'Francais'), + ('eo', 'Esperanto'), ) TEMPLATE_DEBUG = True diff --git a/rakelib/i18n.rake b/rakelib/i18n.rake index 71ed4dcbfb276365e60b2ecd08ff076b7e8a4277..b6c65dba42ca5ac4798dd003ab28e5c1485f9a1b 100644 --- a/rakelib/i18n.rake +++ b/rakelib/i18n.rake @@ -18,7 +18,7 @@ namespace :i18n do desc "Simulate international translation by generating dummy strings corresponding to source strings." task :dummy do source_files = Dir["#{REPO_ROOT}/conf/locale/en/LC_MESSAGES/*.po"] - dummy_locale = 'fr' + dummy_locale = 'eo' cmd = File.join(REPO_ROOT, "i18n", "make_dummy.py") for file in source_files do sh("#{cmd} #{file} #{dummy_locale}")