package.js incorrectly attempts to set the locale dir
From https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/script/package.js#L94 it looks like the package.js module is intended to use the message catalogs while running uninstalled. However, that doesn't work.
It assumes that passing, e.g. $MESON_BUILD_ROOT/po
as the parameter to Gettext.bindtextdomain()
will work, because that's where the en.gmo
, fr.gmo
, ko.gmo
etc files are. But bindtextdomain(domain, dirname)
actually expects a directory structure of $dirname/en/LC_MESSAGES/$domain.mo
. So the files have to be renamed and put in this particular directory structure. This could be done in Package.initGettext()
, as a one-time startup cost.
The desired outcome of this issue is to be able to run https://github.com/gcampax/gtk-js-app uninstalled with Meson and be able to see the Italian translations (e.g., with LANGUAGE=it_IT.UTF-8 meson compile -C _build devel
)