From 9b12e0cb8d886c6caed90dab3e082b4a07844d82 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Aug 2023 20:28:00 +0530 Subject: [PATCH] Fix #2033192 [English appears three times and Spanish two times in the Choose language drop-down menu](https://bugs.launchpad.net/calibre/+bug/2033192) --- setup/translations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup/translations.py b/setup/translations.py index e5cfc5a03b..0622827644 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -273,8 +273,12 @@ class Translations(POT): # {{{ f.write(h), f.write(data) def is_po_file_ok(self, x): - # sr@latin.po is identical to sr.po - return os.path.splitext(os.path.basename(x))[0] != 'sr@latin' + bname = os.path.splitext(os.path.basename(x))[0] + # sr@latin.po is identical to sr.po. And we dont support country + # specific variants except for Portuguese and Chinese + return bname not in { + 'sr@latin', 'en_AU', 'en_GB', 'en_CA', 'fr_CA', 'es_MX' + } def po_files(self): return [x for x in glob.glob(os.path.join(self.TRANSLATIONS, __appname__, '*.po')) if self.is_po_file_ok(x)]