Public bug reported:

(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

** Affects: gtk+3.0 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: arb

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1003298

Title:
  Cannot load translations from a locale dir other than the default

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1003298/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to