mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better filtering of translated languages
This commit is contained in:
parent
9b12e0cb8d
commit
05a398750e
@ -275,10 +275,10 @@ class Translations(POT): # {{{
|
||||
def is_po_file_ok(self, x):
|
||||
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'
|
||||
}
|
||||
# specific variants except for a few.
|
||||
if '_' in bname:
|
||||
return bname.partition('_')[0] in ('pt', 'zh', 'bn')
|
||||
return bname != 'sr@latin'
|
||||
|
||||
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)]
|
||||
|
@ -328,6 +328,8 @@ _extra_lang_codes = {
|
||||
'pt_BR' : _('Brazilian Portuguese'),
|
||||
'zh_CN' : _('Simplified Chinese'),
|
||||
'zh_TW' : _('Traditional Chinese'),
|
||||
'bn_IN' : _('Indian Bengali'),
|
||||
'bn_BD' : _('Bangladeshi Bengali'),
|
||||
'en' : _('English'),
|
||||
'und' : _('Unknown')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user