Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-11-03 00:03:15 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-11-03 00:03:15 +0400
commitc9307ec6a3d1dd74e7e417634358e15d6c1022e2 (patch)
tree62113cef4e9ea7d13602972dce48a5cd1bd9a2b1 /release/scripts/modules/bl_i18n_utils/update_languages_menu.py
parent41cd2d8e841fbbc85aad715ecfcf58848c6831e6 (diff)
Fix for [#32992] Switching language does nothing under Windows.
Our current intl build for windows is quite old (don't know the exact version), and does not have the new setlocale overwrite. Problem is, new windows dll have no more the gettext_putenv helper, which is currently mandatory to make it work for this OS. So back for now to the ugly long_locales for win. Best fix is probably to build our own static version of libl, but this is not trivial and will require some time. :/ PS: I had a look over i18n/translation in wxWidget, Qt and boost: all implement their own system, even though wxWidget and boost use po/mo files...
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/update_languages_menu.py')
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_languages_menu.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/update_languages_menu.py b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
index 5eeeb152af7..d45a5543220 100755
--- a/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
+++ b/release/scripts/modules/bl_i18n_utils/update_languages_menu.py
@@ -53,7 +53,7 @@ FLAG_MESSAGES = {
def find_matching_po(languages, stats, forbidden):
"""Match languages defined in LANGUAGES setting to relevant po, if possible!"""
ret = []
- for uid, label, org_key in languages:
+ for uid, label, org_key, long_loc in languages:
key = org_key
if key not in stats:
# Try to simplify the key (eg from es_ES to es).
@@ -64,11 +64,11 @@ def find_matching_po(languages, stats, forbidden):
key = key + org_key[org_key.index('@'):]
if key in stats:
if key in forbidden:
- ret.append((stats[key], uid, label, org_key, FORBIDDEN))
+ ret.append((stats[key], uid, label, org_key, long_loc, FORBIDDEN))
else:
- ret.append((stats[key], uid, label, org_key, OK))
+ ret.append((stats[key], uid, label, org_key, long_loc, OK))
else:
- ret.append((0.0, uid, label, org_key, MISSING))
+ ret.append((0.0, uid, label, org_key, long_loc, MISSING))
return ret
def main():
@@ -103,14 +103,14 @@ def main():
stats = sorted(stats, key=lambda it: it[0], reverse=True)
langs_cats = [[] for i in range(len(limits))]
highest_uid = 0
- for prop, uid, label, key, flag in stats:
+ for prop, uid, label, key, long_loc, flag in stats:
if prop < limits[idx][0]:
# Sub-sort languages by iso-codes.
langs_cats[idx].sort(key=lambda it: it[2])
idx += 1
if prop < min_trans and flag == OK:
flag = TOOLOW
- langs_cats[idx].append((uid, label, key, flag))
+ langs_cats[idx].append((uid, label, key, long_loc, flag))
if abs(uid) > highest_uid:
highest_uid = abs(uid)
# Sub-sort last group of languages by iso-codes!
@@ -120,7 +120,7 @@ def main():
f.write("# and to generate translation menu.\n")
f.write("#\n")
f.write("# File format:\n")
- f.write("# ID:MENULABEL:ISOCODE\n")
+ f.write("# ID:MENULABEL:ISOCODE:WINCODE\n")
f.write("# ID must be unique, except for 0 value (marks categories for menu).\n")
f.write("# Line starting with a # are comments!\n")
f.write("#\n")
@@ -130,17 +130,17 @@ def main():
f.write("#\n")
# Write "category menu label"...
if langs_cat:
- f.write("0:{}:\n".format(cat[1]))
+ f.write("0:{}::\n".format(cat[1]))
else:
# Do not write the category if it has no language!
f.write("# Void category! #0:{}:\n".format(cat[1]))
# ...and all matching language entries!
- for uid, label, key, flag in langs_cat:
+ for uid, label, key, long_loc, flag in langs_cat:
if flag == OK:
- f.write("{}:{}:{}\n".format(uid, label, key))
+ f.write("{}:{}:{}:{}\n".format(uid, label, key, long_loc))
else:
# Non-existing, commented entry!
- f.write("# {} #{}:{}:{}\n".format(FLAG_MESSAGES[flag], uid, label, key))
+ f.write("# {} #{}:{}:{}:{}\n".format(FLAG_MESSAGES[flag], uid, label, key, long_loc))
if __name__ == "__main__":