From bd8fce5a8a67c097f17cd75077b4e950e6462ed0 Mon Sep 17 00:00:00 2001 From: Sarina Canelake Date: Tue, 19 Nov 2013 10:28:02 -0500 Subject: [PATCH] Change dummy locale to Esperanto --- .gitignore | 3 +++ cms/djangoapps/contentstore/tests/test_i18n.py | 13 +++++++------ cms/envs/dev.py | 2 +- conf/locale/config | 2 +- i18n/config.py | 2 +- i18n/make_dummy.py | 5 +++-- i18n/tests/test_config.py | 2 +- lms/envs/dev.py | 2 +- rakelib/i18n.rake | 2 +- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 46964cd2af..b3f7473dc0 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 c156f3f4cf..c7e32a8689 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'

' diff --git a/cms/envs/dev.py b/cms/envs/dev.py index 6871295356..ea66688a8a 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 67252b1fa0..8a2a31435d 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 4f246ed942..6f3e5d7773 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 6c14edd45a..20eac03522 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 bcec6ac354..0ca94acdd1 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 79891756fc..1fe7fc330c 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 71ed4dcbfb..b6c65dba42 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}")