Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
afaf0f57
Commit
afaf0f57
authored
Nov 19, 2013
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1709 from edx/sarina/change-dummy-i18n-language
Change dummy locale to Esperanto
parents
57cb9833
bd8fce5a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
12 deletions
+17
-12
.gitignore
+3
-0
cms/djangoapps/contentstore/tests/test_i18n.py
+5
-4
cms/envs/dev.py
+1
-1
conf/locale/config
+1
-1
i18n/config.py
+1
-1
i18n/make_dummy.py
+3
-2
i18n/tests/test_config.py
+1
-1
lms/envs/dev.py
+1
-1
rakelib/i18n.rake
+1
-1
No files found.
.gitignore
View file @
afaf0f57
...
@@ -28,6 +28,9 @@ cms/envs/private.py
...
@@ -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/
...
...
cms/djangoapps/contentstore/tests/test_i18n.py
View file @
afaf0f57
...
@@ -73,8 +73,8 @@ class InternationalizationTest(ModuleStoreTestCase):
...
@@ -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,9 +82,10 @@ class InternationalizationTest(ModuleStoreTestCase):
...
@@ -82,9 +82,10 @@ 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
=
(
...
...
cms/envs/dev.py
View file @
afaf0f57
...
@@ -12,7 +12,7 @@ DEBUG = True
...
@@ -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"
,
...
...
conf/locale/config
View file @
afaf0f57
{
{
"locales" : ["en"],
"locales" : ["en"],
"dummy-locale" : "
fr
"
"dummy-locale" : "
eo
"
}
}
i18n/config.py
View file @
afaf0f57
...
@@ -49,7 +49,7 @@ class Configuration:
...
@@ -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.
"""
"""
...
...
i18n/make_dummy.py
View file @
afaf0f57
...
@@ -7,7 +7,8 @@
...
@@ -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 @@
...
@@ -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
...
...
i18n/tests/test_config.py
View file @
afaf0f57
...
@@ -29,5 +29,5 @@ class TestConfiguration(TestCase):
...
@@ -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
)
lms/envs/dev.py
View file @
afaf0f57
...
@@ -19,7 +19,7 @@ DEBUG = True
...
@@ -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
...
...
rakelib/i18n.rake
View file @
afaf0f57
...
@@ -18,7 +18,7 @@ namespace :i18n do
...
@@ -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
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment