Change dummy locale to Esperanto
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -28,6 +28,9 @@ cms/envs/private.py
|
|||||||
*.mo
|
*.mo
|
||||||
conf/locale/en/LC_MESSAGES/*.po
|
conf/locale/en/LC_MESSAGES/*.po
|
||||||
!messages.po
|
!messages.po
|
||||||
|
### Remove when we have real Esperanto translations. For now, ignore
|
||||||
|
### dummy Esperanto files.
|
||||||
|
conf/locale/eo/*
|
||||||
|
|
||||||
### Testing artifacts
|
### Testing artifacts
|
||||||
.testids/
|
.testids/
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ class InternationalizationTest(ModuleStoreTestCase):
|
|||||||
# ****
|
# ****
|
||||||
#
|
#
|
||||||
# This test will break when we replace this fake 'test' language
|
# This test will break when we replace this fake 'test' language
|
||||||
# with actual French. This test will need to be updated with
|
# with actual Esperanto. This test will need to be updated with
|
||||||
# actual French at that time.
|
# actual Esperanto at that time.
|
||||||
# Test temporarily disable since it depends on creation of dummy strings
|
# Test temporarily disable since it depends on creation of dummy strings
|
||||||
@skip
|
@skip
|
||||||
def test_course_with_accents(self):
|
def test_course_with_accents(self):
|
||||||
@@ -82,10 +82,11 @@ class InternationalizationTest(ModuleStoreTestCase):
|
|||||||
self.client = AjaxEnabledTestClient()
|
self.client = AjaxEnabledTestClient()
|
||||||
self.client.login(username=self.uname, password=self.password)
|
self.client.login(username=self.uname, password=self.password)
|
||||||
|
|
||||||
resp = self.client.get_html('/course',
|
resp = self.client.get_html(
|
||||||
{},
|
'/course',
|
||||||
HTTP_ACCEPT_LANGUAGE='fr'
|
{},
|
||||||
)
|
HTTP_ACCEPT_LANGUAGE='eo'
|
||||||
|
)
|
||||||
|
|
||||||
TEST_STRING = (
|
TEST_STRING = (
|
||||||
u'<h1 class="title-1">'
|
u'<h1 class="title-1">'
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ DEBUG = True
|
|||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
# For displaying the dummy text, we need to provide a language mapping.
|
# For displaying the dummy text, we need to provide a language mapping.
|
||||||
LANGUAGES = (
|
LANGUAGES = (
|
||||||
('fr', 'Francais'),
|
('eo', 'Esperanto'),
|
||||||
)
|
)
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
LOGGING = get_logger_config(ENV_ROOT / "log",
|
LOGGING = get_logger_config(ENV_ROOT / "log",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"locales" : ["en"],
|
"locales" : ["en"],
|
||||||
"dummy-locale" : "fr"
|
"dummy-locale" : "eo"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class Configuration:
|
|||||||
@property
|
@property
|
||||||
def dummy_locale(self):
|
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.
|
Throws exception if no dummy-locale is declared.
|
||||||
The locale is a string.
|
The locale is a string.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
# see http://www.loc.gov/standards/iso639-2/php/code_list.php
|
# see http://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||||
#
|
#
|
||||||
# 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='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:
|
# po files can be generated with this:
|
||||||
# django-admin.py makemessages --all --extension html -l en
|
# django-admin.py makemessages --all --extension html -l en
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
# $ ./make_dummy.py ../conf/locale/en/LC_MESSAGES/django.po
|
# $ ./make_dummy.py ../conf/locale/en/LC_MESSAGES/django.po
|
||||||
#
|
#
|
||||||
# generates output to
|
# generates output to
|
||||||
# mitx/conf/locale/fr/LC_MESSAGES/django.po
|
# mitx/conf/locale/eo/LC_MESSAGES/django.po
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
import polib
|
import polib
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ class TestConfiguration(TestCase):
|
|||||||
self.assertIsNotNone(locales)
|
self.assertIsNotNone(locales)
|
||||||
self.assertIsInstance(locales, list)
|
self.assertIsInstance(locales, list)
|
||||||
self.assertIn('en', locales)
|
self.assertIn('en', locales)
|
||||||
self.assertEqual('fr', CONFIGURATION.dummy_locale)
|
self.assertEqual('eo', CONFIGURATION.dummy_locale)
|
||||||
self.assertEqual('en', CONFIGURATION.source_locale)
|
self.assertEqual('en', CONFIGURATION.source_locale)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ DEBUG = True
|
|||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
# For displaying the dummy text, we need to provide a language mapping.
|
# For displaying the dummy text, we need to provide a language mapping.
|
||||||
LANGUAGES = (
|
LANGUAGES = (
|
||||||
('fr', 'Francais'),
|
('eo', 'Esperanto'),
|
||||||
)
|
)
|
||||||
TEMPLATE_DEBUG = True
|
TEMPLATE_DEBUG = True
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace :i18n do
|
|||||||
desc "Simulate international translation by generating dummy strings corresponding to source strings."
|
desc "Simulate international translation by generating dummy strings corresponding to source strings."
|
||||||
task :dummy do
|
task :dummy do
|
||||||
source_files = Dir["#{REPO_ROOT}/conf/locale/en/LC_MESSAGES/*.po"]
|
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")
|
cmd = File.join(REPO_ROOT, "i18n", "make_dummy.py")
|
||||||
for file in source_files do
|
for file in source_files do
|
||||||
sh("#{cmd} #{file} #{dummy_locale}")
|
sh("#{cmd} #{file} #{dummy_locale}")
|
||||||
|
|||||||
Reference in New Issue
Block a user