mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2033192 [English appears three times and Spanish two times in the Choose language drop-down menu](https://bugs.launchpad.net/calibre/+bug/2033192)
This commit is contained in:
parent
6966986ece
commit
9b12e0cb8d
@ -273,8 +273,12 @@ class Translations(POT): # {{{
|
|||||||
f.write(h), f.write(data)
|
f.write(h), f.write(data)
|
||||||
|
|
||||||
def is_po_file_ok(self, x):
|
def is_po_file_ok(self, x):
|
||||||
# sr@latin.po is identical to sr.po
|
bname = os.path.splitext(os.path.basename(x))[0]
|
||||||
return os.path.splitext(os.path.basename(x))[0] != 'sr@latin'
|
# 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):
|
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)]
|
return [x for x in glob.glob(os.path.join(self.TRANSLATIONS, __appname__, '*.po')) if self.is_po_file_ok(x)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user