UI Translations: fix add-on translation PO export #104942
@ -344,7 +344,9 @@ class UI_OT_i18n_addon_translation_export(Operator):
|
|||||||
if not lng.use:
|
if not lng.use:
|
||||||
print("Skipping {} language ({}).".format(lng.name, lng.uid))
|
print("Skipping {} language ({}).".format(lng.name, lng.uid))
|
||||||
continue
|
continue
|
||||||
uid = utils_i18n.find_best_isocode_matches(lng.uid, trans.trans.keys())
|
translation_keys = {k for k in trans.trans.keys()
|
||||||
|
if k != self.settings.PARSER_TEMPLATE_ID}
|
||||||
|
uid = utils_i18n.find_best_isocode_matches(lng.uid, translation_keys)
|
||||||
if uid:
|
if uid:
|
||||||
uids.append(uid[0])
|
uids.append(uid[0])
|
||||||
|
|
||||||
@ -357,8 +359,8 @@ class UI_OT_i18n_addon_translation_export(Operator):
|
|||||||
if not os.path.isfile(path):
|
if not os.path.isfile(path):
|
||||||
continue
|
continue
|
||||||
msgs = utils_i18n.I18nMessages(kind='PO', src=path, settings=self.settings)
|
msgs = utils_i18n.I18nMessages(kind='PO', src=path, settings=self.settings)
|
||||||
msgs.update(trans.msgs[self.settings.PARSER_TEMPLATE_ID])
|
msgs.update(trans.trans[self.settings.PARSER_TEMPLATE_ID])
|
||||||
trans.msgs[uid] = msgs
|
trans.trans[uid] = msgs
|
||||||
|
|
||||||
trans.write(kind='PO', langs=set(uids))
|
trans.write(kind='PO', langs=set(uids))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user