From a64c46b830252c1cb5357a2edc67b19d524803e2 Mon Sep 17 00:00:00 2001 From: Jehan Date: Tue, 21 Jan 2025 15:55:16 +0100 Subject: [PATCH] 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. --- build/windows/installer/lang/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/windows/installer/lang/meson.build b/build/windows/installer/lang/meson.build index 99f4fe4c5a..548747b6e1 100644 --- a/build/windows/installer/lang/meson.build +++ b/build/windows/installer/lang/meson.build @@ -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(