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
c0470008
Commit
c0470008
authored
Jan 28, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make i18n dummy dummy-ify all source english strings (rather than a static list)
parent
88789c1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
22 deletions
+6
-22
conf/locale/config.yaml
+1
-12
i18n/config.py
+0
-1
i18n/make_dummy.py
+5
-9
No files found.
conf/locale/config.yaml
View file @
c0470008
# Configuration for i18n workflow.
locales
:
locales
:
-
en
# More languages we might want someday, these have started on Transifex.
...
...
@@ -32,17 +32,6 @@ locales:
# The locale used for fake-accented English, for testing.
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.
ignore_dirs
:
-
docs
...
...
i18n/config.py
View file @
c0470008
...
...
@@ -22,7 +22,6 @@ class Configuration(object):
'locales'
:
[
'en'
],
'segment'
:
{},
'source_locale'
:
'en'
,
'dummy_sources'
:
[],
}
def
__init__
(
self
,
filename
):
...
...
i18n/make_dummy.py
View file @
c0470008
...
...
@@ -6,8 +6,6 @@
# two letter language codes reference:
# 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
# localized for. So we are using a well-known language (default='eo').
# Django languages are listed in django.conf.global_settings.LANGUAGES
...
...
@@ -19,10 +17,8 @@
#
# $ ./make_dummy.py
#
# generates output to
# CONFIGURATION.get_messages_dir(CONFIGURATION.dummy_locale)
# (for example,
# edx-platform/conf/locale/eo/LC_MESSAGES/)
# generates output conf/locale/$DUMMY_LOCALE/LC_MESSAGES,
# where $DUMMY_LOCALE is the dummy_locale value set in the i18n config
import
os
,
sys
import
polib
...
...
@@ -63,8 +59,8 @@ def new_filename(original_filename, new_locale):
if
__name__
==
'__main__'
:
LOCALE
=
CONFIGURATION
.
dummy_locale
SOURCE_MSGS_DIR
=
CONFIGURATION
.
source_messages_dir
print
"Processing source language files into dummy strings:"
,
for
source_file
in
CONFIGURATION
.
dummy_sources
:
print
source_file
,
print
"Processing source language files into dummy strings:"
for
source_file
in
CONFIGURATION
.
source_messages_dir
.
walkfiles
(
'*.po'
)
:
print
' '
,
source_file
.
relpath
()
main
(
SOURCE_MSGS_DIR
.
joinpath
(
source_file
),
LOCALE
)
print
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