From 6bb8d5e92bf4a75f0dfe28f5b1520b7575047b66 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 6 Mar 2018 23:44:14 +0100 Subject: [PATCH] a couple languages don't use "other" in plurals: be pl ru --- tools/remove-unused-and-blank-translations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/remove-unused-and-blank-translations.py b/tools/remove-unused-and-blank-translations.py index e46fd98f5..e25e6ca4c 100755 --- a/tools/remove-unused-and-blank-translations.py +++ b/tools/remove-unused-and-blank-translations.py @@ -30,7 +30,8 @@ for d in sorted(glob.glob(os.path.join(resdir, 'values-*'))): body = fp.read() body = re.sub(b'.*.*\n', b'', body) # Weblate is not handling plurals right https://github.com/WeblateOrg/weblate/issues/520 - if os.path.basename(d)[7:9] in ('ja', 'ko', 'zh'): + language = os.path.basename(d)[7:9] # careful, its not the whole locale! + if language in ('ja', 'ko', 'zh'): body = re.sub(b'', b'', body) with open(str_path, 'wb') as fp: fp.write(body) @@ -61,7 +62,7 @@ for d in sorted(glob.glob(os.path.join(resdir, 'values-*'))): e.remove(item) elif item.attrib['quantity'] == 'other': found_other = True - if not found_other: + if not found_other and language not in ('be', 'pl', 'ru'): print(os.path.relpath(str_path) + ': Missing "other" string in', e.attrib['name']) count += 1