mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-30 23:00:21 -04:00
Fix #813924 ('zh-TW' come up in language list of News Schedule dialog)
This commit is contained in:
parent
ca1367048d
commit
576e8aaebf
@ -64,7 +64,7 @@ class UnitedDaily(BasicNewsRecipe):
|
||||
|
||||
__author__ = 'Eddie Lau'
|
||||
__version__ = '1.1'
|
||||
language = 'zh-TW'
|
||||
language = 'zh_TW'
|
||||
publisher = 'United Daily News Group'
|
||||
description = 'United Daily (Taiwan)'
|
||||
category = 'News, Chinese, Taiwan'
|
||||
|
@ -72,7 +72,7 @@ def set_translators():
|
||||
if lang:
|
||||
buf = iso639 = None
|
||||
mpath = get_lc_messages_path(lang)
|
||||
if os.access(mpath+'.po', os.R_OK):
|
||||
if mpath and os.access(mpath+'.po', os.R_OK):
|
||||
from calibre.translations.msgfmt import make
|
||||
buf = cStringIO.StringIO()
|
||||
make(mpath+'.po', buf)
|
||||
|
@ -217,6 +217,8 @@ class RecipeModel(QAbstractItemModel, SearchQueryParser):
|
||||
self.all_urns.add(urn)
|
||||
if ok(urn):
|
||||
lang = x.get('language', 'und')
|
||||
if lang:
|
||||
lang = lang.replace('-', '_')
|
||||
if lang not in lang_map:
|
||||
lang_map[lang] = factory(NewsCategory, new_root, lang)
|
||||
factory(NewsItem, lang_map[lang], urn, x.get('title'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user