Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
05856903
Commit
05856903
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Patches
Plain Diff
A few improvements to extract.
Use the configuration more, and we don't need to delete files we're about to create.
parent
f76a5e17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/locale/config.yaml
+9
-0
9 additions, 0 deletions
conf/locale/config.yaml
i18n/extract.py
+6
-7
6 additions, 7 deletions
i18n/extract.py
with
15 additions
and
7 deletions
conf/locale/config.yaml
+
9
−
0
View file @
05856903
...
...
@@ -32,6 +32,15 @@ locales:
# The locale used for fake-accented English, for testing.
dummy-locale
:
eo
# Directories we don't search for strings.
ignore_dirs
:
-
docs
-
src
-
i18n
-
test_root
-
common/static/xmodule/modules
-
common/static/xmodule/descriptors
# How should .po files be segmented? See i18n/segment.py for details. Strings
# that are only found in a particular segment are segregated into that .po file
# so that translators can focus on separate parts of the product.
...
...
This diff is collapsed.
Click to expand it.
i18n/extract.py
+
6
−
7
View file @
05856903
...
...
@@ -40,15 +40,13 @@ def main():
create_dir_if_necessary
(
LOCALE_DIR
)
source_msgs_dir
=
CONFIGURATION
.
source_messages_dir
remove_file
(
source_msgs_dir
.
joinpath
(
'
django.po
'
))
generated_files
=
(
'
django-partial.po
'
,
'
djangojs.po
'
,
'
mako.po
'
)
for
filename
in
generated_files
:
remove_file
(
source_msgs_dir
.
joinpath
(
filename
))
generated_files
=
[
'
django-partial.po
'
,
'
djangojs.po
'
,
'
mako.po
'
]
# Prepare makemessages command.
ignore_dirs
=
[
"
docs
"
,
"
src
"
,
"
i18n
"
,
"
test_root
"
]
ignores
=
"
"
.
join
(
"
--ignore={}/*
"
.
format
(
d
)
for
d
in
ignore_dirs
)
makemessages
=
'
django-admin.py makemessages -l en
'
+
ignores
makemessages
=
"
django-admin.py makemessages -l en
"
ignores
=
"
"
.
join
(
"
--ignore={}/*
"
.
format
(
d
)
for
d
in
CONFIGURATION
.
ignore_dirs
)
if
ignores
:
makemessages
+=
"
"
+
ignores
# Extract strings from mako templates.
babel_mako_cmd
=
'
pybabel extract -F %s -c
"
Translators:
"
. -o %s
'
%
(
BABEL_CONFIG
,
BABEL_OUT
)
...
...
@@ -80,6 +78,7 @@ def main():
strip_key_strings
(
po
)
po
.
save
()
def
fix_header
(
po
):
"""
Replace default headers with edX headers
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment