Marking as invalid as per the findings on the upstream bug report: using
the gettext C API (i.e. the locale module) vs the gettext Python API
(i.e. the gettext module) makes things work.
** Changed in: gtk+3.0 (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gtk+3.0 in Ubuntu.
https://bugs.launchpad.net/bugs/1003298
Title:
Cannot load translations from a locale dir other than the default
Status in “gtk+3.0” package in Ubuntu:
Invalid
Bug description:
(Filed upstream, adding it here to keep track of it in the distro and
record the bugs that need fixing to improve the Ubuntu app developer
experience)
I've got an application that needs to be installed in /opt, and I've
noticed that its translations are not loaded by GtkBuilder.
It turns out that even if I specify the location to load them from
(with gettext's bindtextdomain() function), GtkBuilder ignores that
and tries to find them in '/usr/share/locale'. I've also tried to use
the gtk-builder-set-translation-domain() function to explicitly set
the domain for GtkBuilder, but that did not make any difference. I'd
probably rather need a gtk-builder-bind-text-domain one, which does
not exist.
In any case, I don't quite follow why gtk-builder-set-translation-
domain() is needed at all and GtkBuilder does not just pick the
translation domain and the locale dir values from gettext.
In short, GtkBuilder ignores any attempt to define a locale dir and
just uses the default from the system.
I'm attaching a Python example for testing purposes.
To run the example:
* Copy the build/share/locale/ca/LC_MESSAGES/testglade.mo file to
/tmp/share/locale/ca/LC_MESSAGES
* Run the app with LANGUAGE=ca ./testglade.py
Notice that the message output on the command line is translated,
whereas those from the UI are not.
I'm also aware of this old PyGTK bug [2], but none of the tentative
workarounds there work to make GtkBuilder load translations from
another location than '/usr/share/locale'.
Any help or comments would be appreciated, thanks!
[1]:
http://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-set-translation-domain
[2]: https://bugzilla.gnome.org/show_bug.cgi?id=574520
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1003298/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp