Python + GtkBuilder: translations not shown

Bug #586541 reported by Gabor Karsay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Awn Extras
Fix Released
Medium
onox

Bug Description

Distribution: Ubuntu 10.04 Lucid Lynx
Awn and Awn Extras: 0.4.0-0ubuntu1 (installed from Ubuntu repository lucid/universe)
Newest translations installed.

Cairo Clock translations are not shown, although they exist.

Steps to reproduce: Switch to French locale, be sure you have the translation files (due to bug #583948 they might not be there), open Cairo Clock's preferences. The preference dialog should be fully translated but it isn't.

I understand no python at all, but my assumption is that this is connected with GtkBuilder. The other python-applets have translated preference dialogs, but they are all coded in the python script itself, whereas Cairo Clock uses a .ui-file and GtkBuilder.

Related branches

Mark Lee (malept)
tags: added: applet cairo-clock i18n
Changed in awn-extras:
assignee: nobody → onox (onox)
importance: Undecided → Medium
Revision history for this message
Gabor Karsay (gabor-karsay) wrote :

I found a possible solution at https://bugzilla.gnome.org/show_bug.cgi?id=574520

Adding these lines to cairo-clock.py helps:

import gtk.glade
gtk.glade.bindtextdomain("awn-extras", "/usr/share/locale/")
gtk.glade.textdomain("awn-extras")

I guess it's not a good solution though. In the aforementioned Gnome bug are more details, also a comment from Ubuntu's Sebastien Bacher.

And there are more applets affected, e.g. the weather applet.

Revision history for this message
Gabor Karsay (gabor-karsay) wrote :

This is a proposed patch.
Testing: Start awn with awn-extras from trunk with LANGUAGE=fr. Open the preferences dialog e.g. in Cairo Clock or the Weather applet (any python applet, that uses gtkbuilder). It is completely English (except for stock-items like close-button).
Install patched awn-extras; now these dialogs should be translated in French.

It's a selfmade patch (meaning not by bazaar), assuming to patch directory "awn-extras". Tested with "patch -p0 < python-gtkbuilder-locale.patch".

summary: - cairo-clock translations not shown
+ Python + GtkBuilder: translations not shown
tags: added: bandwidth-monitor battery comics cpu-freq hardware-sensors mail media-control media-player mount shinyswitcher volume-control weather
Revision history for this message
onox (onox) wrote :

Fixed in revision 1354. As I only have english and dutch translation stuff on my system (got lot of output telling french wasn't supported) and because dutch translations in awn-extras are like 0%, I have absolutely no idea whether this is gonna work.

Changed in awn-extras:
milestone: none → 0.4.2
status: New → Fix Committed
Revision history for this message
Gabor Karsay (gabor-karsay) wrote :

Thanks, it works for me. I tested with this command:
$ LANGUAGE=fr avant-window-navigator
so there is no need to install a new locale for the whole system (I wasn't aware of that possibility at the beginning). I have no error messages about french locale, just some markup problems that are fixed in newest translations, so basically everything seems fine.

Povilas Kanapickas (p12)
Changed in awn-extras:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.