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
c329270f
Commit
c329270f
authored
Jan 10, 2014
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont extract test_root strings
parent
520822c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
i18n/extract.py
+12
-12
No files found.
i18n/extract.py
View file @
c329270f
...
...
@@ -44,29 +44,29 @@ def main():
for
filename
in
generated_files
:
remove_file
(
source_msgs_dir
.
joinpath
(
filename
))
# 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
# Extract strings from mako templates.
babel_mako_cmd
=
'pybabel extract -F
%
s -c "Translators:" . -o
%
s'
%
(
BABEL_CONFIG
,
BABEL_OUT
)
# Extract strings from django source files.
make_django_cmd
=
(
'django-admin.py makemessages -l en --ignore=src/* --ignore=i18n/* '
'--extension html'
)
# Extract strings from Javascript source files.
make_djangojs_cmd
=
(
'django-admin.py makemessages -l en --ignore=src/* --ignore=i18n/* '
'-d djangojs --extension js'
)
execute
(
babel_mako_cmd
,
working_directory
=
BASE_DIR
)
# Extract strings from django source files, including .py files.
make_django_cmd
=
makemessages
+
' --extension html'
execute
(
make_django_cmd
,
working_directory
=
BASE_DIR
)
# Extract strings from Javascript source files.
make_djangojs_cmd
=
makemessages
+
' -d djangojs --extension js'
execute
(
make_djangojs_cmd
,
working_directory
=
BASE_DIR
)
# makemessages creates 'django.po'. This filename is hardcoded.
# Rename it to django-partial.po to enable merging into django.po later.
os
.
rename
(
source_msgs_dir
.
joinpath
(
'django.po'
),
source_msgs_dir
.
joinpath
(
'django-partial.po'
)
)
execute
(
make_djangojs_cmd
,
working_directory
=
BASE_DIR
)
for
filename
in
generated_files
:
LOG
.
info
(
'Cleaning
%
s'
%
filename
)
...
...
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