Using the transifex client to manage the translations

This commit is contained in:
sh4nks committed 2015-01-26 13:08:07 +01:00
1 parent 15a1b6c69d
commit 6cc5d2fa9d
3 files changed
+1634 -6

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
[main]
host = https://www.transifex.com
[flaskbb.messagespot]
file_filter = flaskbb/translations/<lang>/LC_MESSAGES/messages.po
source_file = flaskbb/translations/messages.pot
source_lang = en
type = PO
File diff suppressed because it is too large. Load diff
+6 -6
View File
@@ -193,12 +193,12 @@ def update_translations():
Updates the translations
"""
translations_folder = os.path.join(app.root_path, "translations")
source_file = os.path.join(translations_folder, "messages.pot")
subprocess.call(["pybabel", "extract", "-F", "babel.cfg",
"-k", "lazy_gettext", "-o", "messages.pot", "."])
subprocess.call(["pybabel", "update", "-i", "messages.pot",
"-k", "lazy_gettext", "-o", source_file, "."])
subprocess.call(["pybabel", "update", "-i", source_file,
"-d", translations_folder])
#os.unlink("messages.pot")
@manager.command
@@ -207,12 +207,12 @@ def add_translations(translation):
Adds a new language to the translations
"""
translations_folder = os.path.join(app.root_path, "translations")
source_file = os.path.join(translations_folder, "messages.pot")
subprocess.call(["pybabel", "extract", "-F", "babel.cfg",
"-k", "lazy_gettext", "-o", "messages.pot", "."])
subprocess.call(["pybabel", "init", "-i", "messages.pot",
"-k", "lazy_gettext", "-o", source_file, "."])
subprocess.call(["pybabel", "init", "-i", source_file,
"-d", translations_folder, "-l", translation])
os.unlink('messages.pot')
@manager.command