After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343081 - Python plugin translation not working
Python plugin translation not working
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
HEAD
Other Linux
: High critical
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-27 03:50 UTC by Nguyen Thai Ngoc Duy
Modified: 2006-06-26 02:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
i18n patch (3.31 KB, patch)
2006-05-27 03:50 UTC, Nguyen Thai Ngoc Duy
committed Details | Review
python plugin i18n support (1.34 KB, patch)
2006-06-24 14:55 UTC, Nguyen Thai Ngoc Duy
none Details | Review

Description Nguyen Thai Ngoc Duy 2006-05-27 03:50:15 UTC
The following add a couple of files to POTFILES.in so that it can be translatable. However python plugin í8n is not working (I doubt because the lack of binddomaintext). Tested with vi.po
Comment 1 Nguyen Thai Ngoc Duy 2006-05-27 03:50:56 UTC
Created attachment 66314 [details] [review]
i18n patch
Comment 2 James "Doc" Livingston 2006-05-27 04:39:35 UTC
I've committed the patch to cvs, thanks.

I'll have a chat with the gedit/ephy plugin people to see if they have any ideas about why python plugins aren't getting translated (our code is nased on those). Bumping up severity, since i18n not working correctly is fairly important.
Comment 3 Nguyen Thai Ngoc Duy 2006-05-27 14:41:03 UTC
With that patch, intltool-update would fail and require to prepend 
[encoding: UTF-8]
in POTFILES.in. I found out that it's because some *.rb-plugin.desktop.in contain utf-8 code.
Comment 4 James "Doc" Livingston 2006-06-07 05:14:39 UTC
With the "[encoding: UTF-8]" bit fixed, does this still occur with cvs?
Comment 5 Nguyen Thai Ngoc Duy 2006-06-07 09:28:10 UTC
Still
Comment 6 James "Doc" Livingston 2006-06-23 13:35:42 UTC
Changing patch state since it got committed already.

I have no idea why this isn't working correctly.
Comment 7 Nguyen Thai Ngoc Duy 2006-06-24 12:08:17 UTC
To test, I added these lines to lyrics.py

from gettext import bindtextdomain, bind_textdomain_codeset, textdomain
bindtextdomain("rhythmbox", "/home/pclouds/local/rb/share/locale")
bind_textdomain_codeset ("rhythmbox", "UTF-8")
textdomain ("rhythmbox")

Now lyric plugin shows Vietnamese perfectly. GETTEXT_PACKAGE and GNOMELOCALEDIR are not available to python plugins. Besides I don't like writing these function calls in every plugins. So it would be best calling the functions from C although I'm not familiar with Python C API.
Comment 8 Nguyen Thai Ngoc Duy 2006-06-24 14:55:19 UTC
Created attachment 67947 [details] [review]
python plugin i18n support

With this patch, lyrics.py's translation works. I have no idea why gettext.install() doesn't work (even if I call it from lyrics.py). And moving gettext.textdomain() to rb-python-module.c doesn't work too :(
Comment 9 Nguyen Thai Ngoc Duy 2006-06-24 15:11:46 UTC
Forget about the last patch. If you remove "from gettext import gettext as _" from  python sources, it will work. gettext.install() installs _() for you already.
Comment 10 James "Doc" Livingston 2006-06-25 02:30:22 UTC
Thanks for looking into this. I've changed all the python sources in cvs, if you can let us know whether that fixes it, it would be great.
Comment 11 Nguyen Thai Ngoc Duy 2006-06-26 02:22:50 UTC
works
Comment 12 James "Doc" Livingston 2006-06-26 02:30:27 UTC
Marking FIXED as per last comment.