mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix checking of iso639 translations
This commit is contained in:
parent
e73dbb0f99
commit
4a3c9ca32f
@ -430,6 +430,8 @@ class Translations(POT): # {{{
|
|||||||
rmap = {}
|
rmap = {}
|
||||||
msgid = None
|
msgid = None
|
||||||
has_errors = False
|
has_errors = False
|
||||||
|
if isinstance(raw, bytes):
|
||||||
|
raw = raw.decode('utf-8')
|
||||||
for match in re.finditer(r'^(msgid|msgstr)\s+"(.*?)"', raw, re.M):
|
for match in re.finditer(r'^(msgid|msgstr)\s+"(.*?)"', raw, re.M):
|
||||||
if match.group(1) == 'msgid':
|
if match.group(1) == 'msgid':
|
||||||
msgid = match.group(2)
|
msgid = match.group(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user