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
eb4d5f1c
Commit
eb4d5f1c
authored
Feb 24, 2014
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also clean up the 3rd-party po files.
parent
a8c60259
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
i18n/extract.py
+8
-2
No files found.
i18n/extract.py
View file @
eb4d5f1c
...
...
@@ -79,25 +79,31 @@ def main():
source_msgs_dir
.
joinpath
(
'djangojs-partial.po'
)
)
files_to_clean
=
set
()
# Extract strings from third-party applications.
for
app_name
in
CONFIGURATION
.
third_party
:
# Import the app to find out where it is. Then use pybabel to extract
# from that directory.
app_module
=
importlib
.
import_module
(
app_name
)
app_dir
=
path
(
app_module
.
__file__
)
.
dirname
()
.
dirname
()
output_file
=
source_msgs_dir
/
(
app_name
+
".po"
)
files_to_clean
.
add
(
output_file
)
babel_cmd
=
'pybabel extract -F {config} -c "Translators:" {app} -o {output}'
babel_cmd
=
babel_cmd
.
format
(
config
=
LOCALE_DIR
/
'babel_third_party.cfg'
,
app
=
app_name
,
output
=
source_msgs_dir
/
(
app_name
+
".po"
)
,
output
=
output_file
,
)
execute
(
babel_cmd
,
working_directory
=
app_dir
)
# Segment the generated files.
segmented_files
=
segment_pofiles
(
"en"
)
files_to_clean
.
update
(
segmented_files
)
# Finish each file.
for
filename
in
segmented_files
:
for
filename
in
files_to_clean
:
LOG
.
info
(
'Cleaning
%
s'
%
filename
)
po
=
pofile
(
source_msgs_dir
.
joinpath
(
filename
))
# replace default headers with edX headers
...
...
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