From a210ff67976829e71c7e380f4f1137ef346b077c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 12 Feb 2019 05:26:47 -0500 Subject: [PATCH] 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. --- ci/txstats.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/txstats.py b/ci/txstats.py index 368ce503e..39ec65575 100644 --- a/ci/txstats.py +++ b/ci/txstats.py @@ -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)