UI Translations: fix add-on translation PO export #104942

Merged
Bastien Montagne merged 1 commits from pioverfour/blender-addons:dp_fix_translation_export into blender-v4.0-release 2023-10-11 14:26:15 +02:00

1 Commits

Author SHA1 Message Date
9d942532dc UI Translations: fix add-on translation export
The export of add-on translations to PO files suffered from two
issues:

1. To find the best file candidate for each language, the exporter
   compares ISO codes. One of the codes it tried to compare with is
   the invalid `__POT__` (`settings.PARSER_TEMPLATE_ID`).

   This would raise an assert in
   `bl_i18n_utils.utils.locale_explode()` because its implementation
   is different from the original `bpy_translations.locale_explode()`
   when given invalid values.

   This key is now filtered out to avoid the exception.

2. With "Update Existing" enabled, it tried to update the nonexistant
   `trans.msgs` of the translations. The proper dictionary is
   `trans.trans`.
2023-10-10 21:11:10 +02:00