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
3422fcfe
Commit
3422fcfe
authored
Apr 27, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update how translations are pulled
parent
cb590405
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
34 deletions
+74
-34
i18n/branch_cleanup.py
+36
-0
i18n/transifex.py
+3
-1
i18n/validate.py
+2
-0
lms/envs/common.py
+33
-33
No files found.
i18n/branch_cleanup.py
0 → 100644
View file @
3422fcfe
#!/usr/bin/env python
"""
Utility for cleaning up your local directory after switching between
branches with different translation levels (eg master branch, with only
reviewed translations, versus dev branch, with all translations)
"""
from
__future__
import
print_function
import
os
from
i18n.config
import
CONFIGURATION
from
i18n.execute
import
execute
def
clean_conf_folder
(
locale
):
"""Remove the configuration directory for `locale`"""
dirname
=
CONFIGURATION
.
get_messages_dir
(
locale
)
command
=
"rm -rf {}"
.
format
(
dirname
)
print
(
command
)
try
:
execute
(
command
)
except
Exception
as
exc
:
print
(
"Encountered error {}; continuing..."
.
format
(
exc
))
return
def
clean_configuration_directory
():
"""
Remove the configuration directories for all locales
in CONFIGURATION.translated_locales
"""
for
locale
in
CONFIGURATION
.
translated_locales
:
clean_conf_folder
(
locale
)
if
__name__
==
'__main__'
:
clean_configuration_directory
()
i18n/transifex.py
View file @
3422fcfe
...
@@ -18,6 +18,8 @@ def push():
...
@@ -18,6 +18,8 @@ def push():
def
pull
():
def
pull
():
print
(
"Pulling languages from transifex..."
)
print
(
"Pulling languages from transifex..."
)
# Pull translations from all languages where there is
# at least 10% reviewed translations
execute
(
'tx pull --mode=reviewed --all'
)
execute
(
'tx pull --mode=reviewed --all'
)
clean_translated_locales
()
clean_translated_locales
()
...
@@ -52,7 +54,7 @@ def clean_file(filename):
...
@@ -52,7 +54,7 @@ def clean_file(filename):
except
Exception
as
exc
:
except
Exception
as
exc
:
# An exception can occur when a language is deleted from Transifex.
# An exception can occur when a language is deleted from Transifex.
# Don't totally fail here.
# Don't totally fail here.
print
(
"Encountered error
%
s with filename
%
s - does language project still exist on Transifex?"
,
exc
,
filename
)
print
(
"Encountered error
{} with filename {} - language project may no longer exist on Transifex"
.
format
(
exc
,
filename
)
)
return
return
if
po
.
header
.
find
(
EDX_MARKER
)
!=
-
1
:
if
po
.
header
.
find
(
EDX_MARKER
)
!=
-
1
:
new_header
=
get_new_header
(
po
)
new_header
=
get_new_header
(
po
)
...
...
i18n/validate.py
View file @
3422fcfe
...
@@ -213,4 +213,6 @@ if __name__ == '__main__':
...
@@ -213,4 +213,6 @@ if __name__ == '__main__':
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
log_level
)
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
log_level
)
# pylint: enable=invalid-name
# pylint: enable=invalid-name
print
(
"Validating languages..."
)
main
(
languages
=
args
.
language
,
empty
=
args
.
empty
,
verbosity
=
args
.
verbose
)
main
(
languages
=
args
.
language
,
empty
=
args
.
empty
,
verbosity
=
args
.
verbose
)
print
(
"Finished validating languages"
)
lms/envs/common.py
View file @
3422fcfe
...
@@ -535,61 +535,61 @@ LANGUAGES = (
...
@@ -535,61 +535,61 @@ LANGUAGES = (
(
'fake2'
,
u'Fake translations'
),
# Another dummy language for testing (not pushed to prod)
(
'fake2'
,
u'Fake translations'
),
# Another dummy language for testing (not pushed to prod)
(
'ar'
,
u'العربية'
),
# Arabic
(
'ar'
,
u'العربية'
),
# Arabic
#
('az', u'azərbaycanca'), # Azerbaijani
(
'az'
,
u'azərbaycanca'
),
# Azerbaijani
#
('bg-bg', u'български (България)'), # Bulgarian (Bulgaria)
(
'bg-bg'
,
u'български (България)'
),
# Bulgarian (Bulgaria)
#
('bn', u'বাংলা'), # Bengali
(
'bn'
,
u'বাংলা'
),
# Bengali
#
('bn-bd', u'বাংলা (বাংলাদেশ)'), # Bengali (Bangladesh)
(
'bn-bd'
,
u'বাংলা (বাংলাদেশ)'
),
# Bengali (Bangladesh)
#
('bs', u'bosanski'), # Bosnian
(
'bs'
,
u'bosanski'
),
# Bosnian
(
'ca'
,
u'Català'
),
# Catalan
(
'ca'
,
u'Català'
),
# Catalan
#
('ca@valencia', u'Català (València)'), # Catalan (Valencia)
(
'ca@valencia'
,
u'Català (València)'
),
# Catalan (Valencia)
(
'cs'
,
u'Čeština'
),
# Czech
(
'cs'
,
u'Čeština'
),
# Czech
#
('cy', u'Cymraeg'), # Welsh
(
'cy'
,
u'Cymraeg'
),
# Welsh
(
'de-de'
,
u'Deutsch (Deutschland)'
),
# German (Germany)
(
'de-de'
,
u'Deutsch (Deutschland)'
),
# German (Germany)
#
('el', u'Ελληνικά'), # Greek
(
'el'
,
u'Ελληνικά'
),
# Greek
(
'en@lolcat'
,
u'LOLCAT English'
),
# LOLCAT English
(
'en@lolcat'
,
u'LOLCAT English'
),
# LOLCAT English
(
'en@pirate'
,
u'Pirate English'
),
# Pirate English
(
'en@pirate'
,
u'Pirate English'
),
# Pirate English
(
'es-419'
,
u'Español (Latinoamérica)'
),
# Spanish (Latin America)
(
'es-419'
,
u'Español (Latinoamérica)'
),
# Spanish (Latin America)
#
('es-ar', u'Español (Argentina)'), # Spanish (Argentina)
(
'es-ar'
,
u'Español (Argentina)'
),
# Spanish (Argentina)
#
('es-ec', u'Español (Ecuador)'), # Spanish (Ecuador)
(
'es-ec'
,
u'Español (Ecuador)'
),
# Spanish (Ecuador)
(
'es-es'
,
u'Español (España)'
),
# Spanish (Spain)
(
'es-es'
,
u'Español (España)'
),
# Spanish (Spain)
#
('es-mx', u'Español (México)'), # Spanish (Mexico)
(
'es-mx'
,
u'Español (México)'
),
# Spanish (Mexico)
#
('es-pe', u'Español (Perú)'), # Spanish (Peru)
(
'es-pe'
,
u'Español (Perú)'
),
# Spanish (Peru)
#
('es-us', u'Español (Estados Unidos)'), # Spanish (United States)
(
'es-us'
,
u'Español (Estados Unidos)'
),
# Spanish (United States)
#
('et-ee', u'Eesti (Eesti)'), # Estonian (Estonia)
(
'et-ee'
,
u'Eesti (Eesti)'
),
# Estonian (Estonia)
#
('eu-es', u'euskara (Espainia)'), # Basque (Spain)
(
'eu-es'
,
u'euskara (Espainia)'
),
# Basque (Spain)
#
('fa', u'فارسی'), # Persian
(
'fa'
,
u'فارسی'
),
# Persian
#
('fa-ir', u'فارسی (ایران)'), # Persian (Iran)
(
'fa-ir'
,
u'فارسی (ایران)'
),
# Persian (Iran)
#
('fi-fi', u'Suomi (Suomi)'), # Finnish (Finland)
(
'fi-fi'
,
u'Suomi (Suomi)'
),
# Finnish (Finland)
(
'fr'
,
u'Français'
),
# French
(
'fr'
,
u'Français'
),
# French
#
('gl', u'Galego'), # Galician
(
'gl'
,
u'Galego'
),
# Galician
#
('he', u'עברית'), # Hebrew
(
'he'
,
u'עברית'
),
# Hebrew
(
'hi'
,
u'हिन्दी'
),
# Hindi
(
'hi'
,
u'हिन्दी'
),
# Hindi
#
('hu', u'magyar'), # Hungarian
(
'hu'
,
u'magyar'
),
# Hungarian
(
'hy-am'
,
u'Հայերեն (Հայաստան)'
),
# Armenian (Armenia)
(
'hy-am'
,
u'Հայերեն (Հայաստան)'
),
# Armenian (Armenia)
(
'id'
,
u'Bahasa Indonesia'
),
# Indonesian
(
'id'
,
u'Bahasa Indonesia'
),
# Indonesian
(
'it-it'
,
u'Italiano (Italia)'
),
# Italian (Italy)
(
'it-it'
,
u'Italiano (Italia)'
),
# Italian (Italy)
(
'ja-jp'
,
u'日本語(日本)'
),
# Japanese (Japan)
(
'ja-jp'
,
u'日本語(日本)'
),
# Japanese (Japan)
#
('kk-kz', u'қазақ тілі (Қазақстан)'), # Kazakh (Kazakhstan)
(
'kk-kz'
,
u'қазақ тілі (Қазақстан)'
),
# Kazakh (Kazakhstan)
#
('km-kh', u'ភាសាខ្មែរ (កម្ពុជា)'), # Khmer (Cambodia)
(
'km-kh'
,
u'ភាសាខ្មែរ (កម្ពុជា)'
),
# Khmer (Cambodia)
(
'ko-kr'
,
u'한국어(대한민국)'
),
# Korean (Korea)
(
'ko-kr'
,
u'한국어(대한민국)'
),
# Korean (Korea)
(
'lt-lt'
,
u'Lietuvių (Lietuva)'
),
# Lithuanian (Lithuania)
(
'lt-lt'
,
u'Lietuvių (Lietuva)'
),
# Lithuanian (Lithuania)
#
('ml', u'മലയാളം'), # Malayalam
(
'ml'
,
u'മലയാളം'
),
# Malayalam
#
('mn', u'Монгол хэл'), # Mongolian
(
'mn'
,
u'Монгол хэл'
),
# Mongolian
#
('ms', u'Bahasa Melayu'), # Malay
(
'ms'
,
u'Bahasa Melayu'
),
# Malay
(
'nb'
,
u'Norsk bokmål'
),
# Norwegian Bokmål
(
'nb'
,
u'Norsk bokmål'
),
# Norwegian Bokmål
#
('ne', u'नेपाली'), # Nepali
(
'ne'
,
u'नेपाली'
),
# Nepali
(
'nl-nl'
,
u'Nederlands (Nederland)'
),
# Dutch (Netherlands)
(
'nl-nl'
,
u'Nederlands (Nederland)'
),
# Dutch (Netherlands)
(
'pl'
,
u'Polski'
),
# Polish
(
'pl'
,
u'Polski'
),
# Polish
(
'pt-br'
,
u'Português (Brasil)'
),
# Portuguese (Brazil)
(
'pt-br'
,
u'Português (Brasil)'
),
# Portuguese (Brazil)
#
('pt-pt', u'Português (Portugal)'), # Portuguese (Portugal)
(
'pt-pt'
,
u'Português (Portugal)'
),
# Portuguese (Portugal)
#
('ru', u'Русский'), # Russian
(
'ru'
,
u'Русский'
),
# Russian
#
('si', u'සිංහල'), # Sinhala
(
'si'
,
u'සිංහල'
),
# Sinhala
#
('sk', u'Slovenčina'), # Slovak
(
'sk'
,
u'Slovenčina'
),
# Slovak
(
'sl'
,
u'Slovenščina'
),
# Slovenian
(
'sl'
,
u'Slovenščina'
),
# Slovenian
#
('th', u'ไทย'), # Thai
(
'th'
,
u'ไทย'
),
# Thai
(
'tr-tr'
,
u'Türkçe (Türkiye)'
),
# Turkish (Turkey)
(
'tr-tr'
,
u'Türkçe (Türkiye)'
),
# Turkish (Turkey)
(
'uk'
,
u'Українська'
),
# Ukranian
(
'uk'
,
u'Українська'
),
# Ukranian
#
('ur', u'اردو'), # Urdu
(
'ur'
,
u'اردو'
),
# Urdu
(
'vi'
,
u'Tiếng Việt'
),
# Vietnamese
(
'vi'
,
u'Tiếng Việt'
),
# Vietnamese
(
'zh-cn'
,
u'中文(简体)'
),
# Chinese (China)
(
'zh-cn'
,
u'中文(简体)'
),
# Chinese (China)
(
'zh-tw'
,
u'中文(台灣)'
),
# Chinese (Taiwan)
(
'zh-tw'
,
u'中文(台灣)'
),
# Chinese (Taiwan)
...
...
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