diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-10-22 18:17:30 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-10-22 18:17:30 +0400 |
commit | 40da6bb531ebb3b43a9e66f31390498620a9c082 (patch) | |
tree | 705404d18206b67da17c0cc0938455486f9ff859 /release/scripts/modules/bl_i18n_utils/update_pot.py | |
parent | 57b7f405a4306d6c8b29fc6cdfc16ab9eb58279a (diff) |
Update of the tools for the new "dynamic" i18n menu, to generate the languages file into locale dir...
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/update_pot.py')
-rwxr-xr-x | release/scripts/modules/bl_i18n_utils/update_pot.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py index 6a7efddda6c..c4d9a2ed20a 100755 --- a/release/scripts/modules/bl_i18n_utils/update_pot.py +++ b/release/scripts/modules/bl_i18n_utils/update_pot.py @@ -38,6 +38,9 @@ except: from . import (settings, utils) +LANGUAGES_CATEGORIES = settings.LANGUAGES_CATEGORIES +LANGUAGES = settings.LANGUAGES + COMMENT_PREFIX = settings.COMMENT_PREFIX COMMENT_PREFIX_SOURCE = settings.COMMENT_PREFIX_SOURCE CONTEXT_PREFIX = settings.CONTEXT_PREFIX @@ -261,7 +264,6 @@ def main(): spell_cache = pickle.load(f) else: spell_cache = set() - print(len(spell_cache)) print("Generating POT file {}…".format(FILE_NAME_POT)) msgs, states = gen_empty_pot() @@ -292,11 +294,22 @@ def main(): print("\tMerged {} messages ({} were already present)." "".format(num_added, num_present)) + print("\tAdding languages labels...") + messages = {(CONTEXT_DEFAULT, lng[1]): + ("Languages’ labels from bl_i18n_utils/settings.py",) + for lng in LANGUAGES} + messages.update({(CONTEXT_DEFAULT, cat[1]): + ("Language categories’ labels from bl_i18n_utils/settings.py",) + for cat in LANGUAGES_CATEGORIES}) + num_added, num_present = merge_messages(msgs, states, messages, + True, spell_cache) + tot_messages += num_added + print("\tAdded {} language messages.".format(num_added)) + # Write back all messages into blender.pot. utils.write_messages(FILE_NAME_POT, msgs, states["comm_msg"], states["fuzzy_msg"]) - print(len(spell_cache)) if SPELL_CACHE and spell_cache: with open(SPELL_CACHE, 'wb') as f: pickle.dump(spell_cache, f) |