Edit book: Fix book locale changing when OPF edited if OPF contains a country code in addition to a language code

This commit is contained in:
Kovid Goyal 2015-04-12 11:04:39 +05:30
parent 9b8bf25a41
commit 8e77a2469c

View File

@ -927,7 +927,8 @@ class Boss(QObject):
f.write(ed.data)
if name == container.opf_name:
container.refresh_mime_map()
set_book_locale(container.mi.language)
lang = container.opf_xpath('//dc:language/text()') or [self.current_metadata.language]
set_book_locale(lang[0])
if container is current_container():
ed.is_synced_to_container = True
if name == container.opf_name: