Don't break if translation can't be parsed
If the .linfo file can't be parsed, use the untranslated name/summary, but don't break activity load.
This commit is contained in:
parent
712682a3b0
commit
f0927c364c
@ -229,6 +229,7 @@ class ActivityBundle(Bundle):
|
|||||||
|
|
||||||
def _parse_linfo(self, linfo_file):
|
def _parse_linfo(self, linfo_file):
|
||||||
cp = ConfigParser()
|
cp = ConfigParser()
|
||||||
|
try:
|
||||||
cp.readfp(linfo_file)
|
cp.readfp(linfo_file)
|
||||||
|
|
||||||
section = 'Activity'
|
section = 'Activity'
|
||||||
@ -242,6 +243,8 @@ class ActivityBundle(Bundle):
|
|||||||
if cp.has_option(section, 'tags'):
|
if cp.has_option(section, 'tags'):
|
||||||
tag_list = cp.get(section, 'tags').strip(';')
|
tag_list = cp.get(section, 'tags').strip(';')
|
||||||
self._tags = [tag.strip() for tag in tag_list.split(';')]
|
self._tags = [tag.strip() for tag in tag_list.split(';')]
|
||||||
|
except ConfigParser.ParsingError as e:
|
||||||
|
logging.exception('Exception reading linfo file: %s', e)
|
||||||
|
|
||||||
def get_locale_path(self):
|
def get_locale_path(self):
|
||||||
"""Get the locale path inside the (installed) activity bundle."""
|
"""Get the locale path inside the (installed) activity bundle."""
|
||||||
|
Loading…
Reference in New Issue
Block a user