i18n: list translations alphabetically

- it's enough to know which "band" a translation is in, no
   need to keep them in translation-completeness order
 - makes it easier to sort-and-spot what languages have moved
   between bands
 - suppress es_ES automatically.
This commit is contained in:
Adriaan de Groot 2019-02-12 05:26:47 -05:00
parent f21e800c24
commit a210ff6797

View File

@ -31,7 +31,7 @@ def output_langs(all_langs, label, filterfunc):
Performs line-wrapping.
"""
these_langs = [l for s, l in all_langs if filterfunc(s)]
out = " ".join(["set( _tx_%s" % label, " ".join(these_langs), ")"])
out = " ".join(["set( _tx_%s" % label, " ".join(sorted(these_langs)), ")"])
width = 68
prefix = ""
@ -55,17 +55,19 @@ def get_tx_stats(token):
if r.status_code != 200:
return 1
suppressed_languages = ( "es_ES", ) # In Transifex, but not used
all_langs = []
j = r.json()
languages = j["stats"]
print("# Total %d languages" % len(languages))
for lang_name in languages:
if lang_name in suppressed_languages:
continue
stats = languages[lang_name]["translated"]["percentage"]
all_langs.append((stats, lang_name))
all_langs.sort(reverse=True)
output_langs(all_langs, "complete", lambda s : s == 1.0)
output_langs(all_langs, "good", lambda s : 1.0 > s >= 0.75)
output_langs(all_langs, "ok", lambda s : 0.75 > s >= 0.05)