From 7375116d46faede26eea38ac2b7ee29513f415e6 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 22 Aug 2022 20:32:30 +0200 Subject: [PATCH] =?UTF-8?q?po-windows-installer:=20fix=20double=20escaped?= =?UTF-8?q?=20ampersand=20in=20XML=20for=20the=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … Windows installer localization. There are kind of 2 separate bugs here: - Direct i18n.gettext() to the proper data directory where to find the ITS file. Otherwise `meson compile gimp30-windows-installer-pot` and `meson compile gimp30-windows-installer-update-po` complained about not knowing XML and falling back to C, which is obviously a problem: > /usr/bin/xgettext: warning: file 'build/windows/installer/lang/setup.isl.xml.in' extension 'xml' is unknown; will try C - Set gt:escapeRule to "no" in the ITS file, otherwise the XML entity is kept as-is in the po file (i.e. "&" stays "&" inside the po files), but it's considered as raw text when merged back to XML, i.e. that the '&' is properly converted to a XML entity, so we end up with a double escape "&". Now the po file will have a '&' which will still be converted to XML entity at merge time. This is actually most likely better than asking translators to handle XML entities themselves (with the possibility to make typos and break the XML entity). See https://savannah.gnu.org/bugs/?58643 --- build/windows/installer/lang/its/gimp-ms-installer-config.its | 1 + po-windows-installer/meson.build | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/windows/installer/lang/its/gimp-ms-installer-config.its b/build/windows/installer/lang/its/gimp-ms-installer-config.its index ffd15e76f5..4d343ad9b6 100644 --- a/build/windows/installer/lang/its/gimp-ms-installer-config.its +++ b/build/windows/installer/lang/its/gimp-ms-installer-config.its @@ -3,4 +3,5 @@ xmlns:gt="https://www.gnu.org/s/gettext/ns/its/extensions/1.0"> + diff --git a/po-windows-installer/meson.build b/po-windows-installer/meson.build index abcb8ed049..1a88b0c03a 100644 --- a/po-windows-installer/meson.build +++ b/po-windows-installer/meson.build @@ -1,2 +1,3 @@ po_windows_installer_dir = meson.current_source_dir() -i18n.gettext(gettext_package + '-windows-installer', preset: 'glib', install: false) +i18n.gettext(gettext_package + '-windows-installer', preset: 'glib', install: false, + data_dirs: meson.source_root() / 'build' / 'windows' / 'installer' / 'lang')