Issue #12776: Underscored .isl langs (pt_BR, zh_CN and zh_TW) lost translation on Installer.

This is again a change in gettext 0.23 whose release notes say:

> The value of the xml:lang attribute, inserted by msgfmt, now conforms to W3C standards.

Our xpath selection now recognizes both the old and new (proper) format
so that it works both with older and new versions of msgfmt.
This commit is contained in:
Jehan 2025-01-21 15:55:16 +01:00
parent f58d36a942
commit a64c46b830

View file

@ -58,11 +58,14 @@ languages = [
# Then, we generate the .isl file for each language using some xsltproc magic
foreach language : languages
lang_code = language.get('code')
# Since gettext 0.23, outputted xml:lang by msgfmt conforms to W3C
# standard. Try both with underscore and hyphens.
web_lang_code = lang_code.replace('_', '-')
if 'default' in language
lang_check = 'value[not(@xml:lang)]'
else
lang_check = 'value[lang(\'@0@\')]'.format(lang_code)
lang_check = 'value[lang(\'@0@\')] | value[lang(\'@1@\')]'.format(lang_code, web_lang_code)
endif
gimp_ms_installer_lang_xsl = configure_file(