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
788ed13b
Commit
788ed13b
authored
Jan 31, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename djangojs.po to djangojs-partial.po in transifex, to prevent header creep
parent
4e879a4c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
13 deletions
+20
-13
.tx/config
+3
-3
conf/locale/config.yaml
+2
-2
i18n/extract.py
+12
-5
i18n/tests/test_extract.py
+1
-1
i18n/tests/test_generate.py
+1
-1
i18n/transifex.py
+1
-1
No files found.
.tx/config
View file @
788ed13b
...
...
@@ -13,9 +13,9 @@ source_file = conf/locale/en/LC_MESSAGES/django-studio.po
source_lang = en
type = PO
[edx-platform.djangojs]
file_filter = conf/locale/<lang>/LC_MESSAGES/djangojs.po
source_file = conf/locale/en/LC_MESSAGES/djangojs.po
[edx-platform.djangojs
-partial
]
file_filter = conf/locale/<lang>/LC_MESSAGES/djangojs
-partial
.po
source_file = conf/locale/en/LC_MESSAGES/djangojs
-partial
.po
source_lang = en
type = PO
...
...
conf/locale/config.yaml
View file @
788ed13b
...
...
@@ -53,7 +53,7 @@ segment:
django-studio.po
:
# produces this .po file..
-
cms/*
# by segregating strings from these files.
# Anything that doesn't match a pattern stays in the original file.
djangojs.po
:
djangojs
-partial
.po
:
djangojs-studio.po
:
-
cms/*
mako.po
:
...
...
@@ -69,5 +69,5 @@ generate_merge:
-
mako-studio.po
-
messages.po
djangojs.po
:
-
djangojs.po
-
djangojs
-partial
.po
-
djangojs-studio.po
i18n/extract.py
View file @
788ed13b
...
...
@@ -6,7 +6,7 @@ See https://edx-wiki.atlassian.net/wiki/display/ENG/PO+File+workflow
This task extracts all English strings from all source code
and produces three human-readable files:
conf/locale/en/LC_MESSAGES/django-partial.po
conf/locale/en/LC_MESSAGES/djangojs.po
conf/locale/en/LC_MESSAGES/djangojs
-partial
.po
conf/locale/en/LC_MESSAGES/mako.po
This task will clobber any existing django.po file.
...
...
@@ -42,15 +42,15 @@ def main():
source_msgs_dir
=
CONFIGURATION
.
source_messages_dir
remove_file
(
source_msgs_dir
.
joinpath
(
'django.po'
))
# Extract strings from mako templates.
babel_mako_cmd
=
'pybabel extract -F
%
s -c "Translators:" . -o
%
s'
%
(
BABEL_CONFIG
,
BABEL_OUT
)
execute
(
babel_mako_cmd
,
working_directory
=
BASE_DIR
)
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
)
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
)
...
...
@@ -66,6 +66,13 @@ def main():
source_msgs_dir
.
joinpath
(
'django-partial.po'
)
)
# makemessages creates 'djangojs.po'. This filename is hardcoded.
# Rename it to djangojs-partial.po to enable merging into djangojs.po later.
os
.
rename
(
source_msgs_dir
.
joinpath
(
'djangojs.po'
),
source_msgs_dir
.
joinpath
(
'djangojs-partial.po'
)
)
# Segment the generated files.
segmented_files
=
segment_pofiles
(
"en"
)
...
...
i18n/tests/test_extract.py
View file @
788ed13b
...
...
@@ -17,7 +17,7 @@ class TestExtract(TestCase):
"""
Tests functionality of i18n/extract.py
"""
generated_files
=
(
'django-partial.po'
,
'djangojs.po'
,
'mako.po'
)
generated_files
=
(
'django-partial.po'
,
'djangojs
-partial
.po'
,
'mako.po'
)
def
setUp
(
self
):
# Skip this test because it takes too long (>1 minute)
...
...
i18n/tests/test_generate.py
View file @
788ed13b
...
...
@@ -16,7 +16,7 @@ class TestGenerate(TestCase):
"""
Tests functionality of i18n/generate.py
"""
generated_files
=
(
'django-partial.po'
,
'djangojs.po'
,
'mako.po'
)
generated_files
=
(
'django-partial.po'
,
'djangojs
-partial
.po'
,
'mako.po'
)
def
setUp
(
self
):
# Subtract 1 second to help comparisons with file-modify time succeed,
...
...
i18n/transifex.py
View file @
788ed13b
...
...
@@ -37,7 +37,7 @@ def clean_locale(locale):
Iterates over machine-generated files.
"""
dirname
=
CONFIGURATION
.
get_messages_dir
(
locale
)
for
filename
in
(
'django-partial.po'
,
'djangojs.po'
,
'mako.po'
):
for
filename
in
(
'django-partial.po'
,
'djangojs
-partial
.po'
,
'mako.po'
):
clean_file
(
dirname
.
joinpath
(
filename
))
def
clean_file
(
file
):
...
...
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