Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:
s/meson.source_root/meson.project_source_root/ to fix:
> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
s/meson.build_root/meson.project_build_root/ to fix:
> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.
Fixing using path() on xdg_email and python ExternalProgram variables:
> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead
s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:
> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
This is purely fixing by meson rebuilds and some regexp fixes. I didn't
touch any semantic.
Basically the "&" XML entity should not have made their way to the
po files. I fixed our script in the previous commit, and now I just
rebuild the po files and clean the entity programmatically so that our
Windows installers for GIMP 2.99.12 release have valid text.
Here is what I did:
(1) I regenerated the pot and po files:
$ meson compile gimp30-windows-installer-pot
$ meson compile gimp30-windows-installer-update-po
(2) I opened all the po files in vim and regexp through them.
Get back the proper Report-Msgid-Bugs-To:
:bufdo! %s$"Report-Msgid-Bugs-To: \\n"$"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gimp/issues\\n"$ge|update
No translations were fuzzy in any po files before this change. I remove
all the fuzzy flags, but only if the msgid contains an ampersand, hence
leaving appropriate fuzzy strings in (the ones where the source string
changed since the last translation):
:bufdo! %s/#, fuzzy\n\([^&]*\)&/\1\&/ge|update
Then I replaced & in msgstr (msgid was fixed through the automatic
regeneration thanks to previous commit, but not the translations) with:
:bufdo! %s/&/\&/ge|update
(3) Finally I did a manual `git diff` review to verify all is good.
In particular, I had to fix a bunch of "E&xit". The string is probably
too short so gettext heuristic failed to consider it likely the same as
"E&xit".
… 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