diff options
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/update_languages_menu.py')
-rwxr-xr-x | release/scripts/modules/bl_i18n_utils/update_languages_menu.py | 20 |
1 files changed, 10 insertions, 10 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 d45a5543220..9b4cb20fadf 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, long_loc in languages: + for uid, label, org_key, 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, long_loc, FORBIDDEN)) + ret.append((stats[key], uid, label, org_key, FORBIDDEN)) else: - ret.append((stats[key], uid, label, org_key, long_loc, OK)) + ret.append((stats[key], uid, label, org_key, OK)) else: - ret.append((0.0, uid, label, org_key, long_loc, MISSING)) + ret.append((0.0, uid, label, org_key, 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, long_loc, flag in stats: + for prop, uid, label, key, 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, long_loc, flag)) + langs_cats[idx].append((uid, label, key, 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:WINCODE\n") + f.write("# ID:MENULABEL:ISOCODE\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") @@ -135,12 +135,12 @@ def main(): # 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, long_loc, flag in langs_cat: + for uid, label, key, flag in langs_cat: if flag == OK: - f.write("{}:{}:{}:{}\n".format(uid, label, key, long_loc)) + f.write("{}:{}:{}\n".format(uid, label, key)) else: # Non-existing, commented entry! - f.write("# {} #{}:{}:{}:{}\n".format(FLAG_MESSAGES[flag], uid, label, key, long_loc)) + f.write("# {} #{}:{}:{}\n".format(FLAG_MESSAGES[flag], uid, label, key)) if __name__ == "__main__": |