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 703469 - Glade UI does not show translated strings
Glade UI does not show translated strings
Status: RESOLVED FIXED
Product: gnome-schedule
Classification: Other
Component: general
2.2.0
Other Linux
: Normal normal
: ---
Assigned To: GNOME Schedule Maintainers
GNOME Schedule Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-02 15:27 UTC by Jiro Matsuzawa
Modified: 2013-07-26 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot for debug (54.15 KB, image/png)
2013-07-02 15:27 UTC, Jiro Matsuzawa
  Details
Make glade UI show translated strings (745 bytes, patch)
2013-07-02 15:35 UTC, Jiro Matsuzawa
none Details | Review
Screenshot after applying patch (54.42 KB, image/png)
2013-07-02 15:37 UTC, Jiro Matsuzawa
  Details
translated strings through programtically set strings (129.09 KB, image/png)
2013-07-15 06:10 UTC, Gaute Hope
  Details

Description Jiro Matsuzawa 2013-07-02 15:27:45 UTC
Created attachment 248236 [details]
Screenshot for debug

The UI created by glade does not show translated strings. I've attached a screenshot which will help you identify the problem. I inserted debug markers ("[i18n]") into translatable strings of the UI using podebug. You can see that some strings including "Advanced" and  "Change edit mode" do not have the marker. It means gnome-schedule cannot show translations correspoinding to those strings. They are from gnome-schedule.glade.
Comment 1 Jiro Matsuzawa 2013-07-02 15:35:22 UTC
Created attachment 248238 [details] [review]
Make glade UI show translated strings

It seems that we need to initialize i18n before importing glade. So I imported lang at the top of mainWindow.py. I checked it fixed the problem.
Comment 2 Jiro Matsuzawa 2013-07-02 15:37:49 UTC
Created attachment 248240 [details]
Screenshot after applying patch

You see that some strings still do not have the debug mark, but they are from the GTK stock items. So that's no problem.
Comment 3 Gaute Hope 2013-07-15 06:10:11 UTC
Created attachment 249159 [details]
translated strings through programtically set strings

Hi,

I think most of those strings are set programatically in src/mainWindow.py (because of a dynamic UI), so they are indeed translated, but through Python-strings.

Regards, Gaute
Comment 4 Jiro Matsuzawa 2013-07-25 15:11:07 UTC
Hmm, I guess your localedir is /usr/share/locale. Glade seems to search /usr/share/locale for message catalogs. For now, it doesn't seem to respect the localedir specified in building gnome-schedule. In other words, if your MO file is installed in /usr/share/locale/${LANG}/LC_MESSAGES, there is no problem. However, if it is installed another directory, the glade UI won't show translated strings.

It might be a bug of libglade, but I'm not sure about that. The patch which I attached works well as a workaround.
Comment 5 Gaute Hope 2013-07-25 16:47:09 UTC
Hm, I didn't install to /usr, just an arbitrary directory.
Comment 6 Gaute Hope 2013-07-25 17:02:41 UTC
What versions are you running of GTK+, libglade and so on? Do you have the necessary gnome-developer tools installed for registering the schemas? Might be problematic if you installed as a different user than the one you tried to run it with if it is to a non-standard location.
Comment 7 Jiro Matsuzawa 2013-07-25 21:33:51 UTC
I use jhbuild to build GNOME modules on Fedora 19. The version of each module usually refers to HEAD of the master branch, i.e. the latest commit.
Here are each of the related modules and the commit which it is besed on:
- gnome-schedule: 57160d633dc1828c1d1a2dcd67cf06d2026271d6
- glib: dc2d3f77811c1247f8c46030557e4f76804bdf9e
- gtk+ 9a0fb236251b40bd03873dc530b72adba5288528
- gtk+-2: 561d1c6358333732bbd11040d7fefa2a0c04031a
- libglade: 8908de2289f58f5197a6877ca9d0ed042b62e5d7 
- glade: 54763c43ffe8e98ecec3705f1031ca25ba793bfa

If you have no problem, I'd like to know what you set the --prefix option to in configuring gnome-schedule and whether you have your mo in /usr/share/locale/${LANG}/LC_MESSAGES. Would you tell me about them?
Comment 8 Gaute Hope 2013-07-25 23:16:21 UTC
I use: $ ./autogen --prefix=$(pwd)/inst; make; make install

I have nothing in /usr/share/locale/${LANG}/LC_MESSAGES except firefox mo's.

Is 'import lang' in mainWindow.py enough to fix this issue for you? Because in that case it shouldn't be a problem to apply your patch.

Regards, Gaute
Comment 9 Jiro Matsuzawa 2013-07-26 01:30:13 UTC
(In reply to comment #8)
> I use: $ ./autogen --prefix=$(pwd)/inst; make; make install
> 
> I have nothing in /usr/share/locale/${LANG}/LC_MESSAGES except firefox mo's.
> 
Thank you for the information.

> Is 'import lang' in mainWindow.py enough to fix this issue for you? Because in
> that case it shouldn't be a problem to apply your patch.
> 
Yes. I've checked the patch fixes the issue. Could you apply it?

Thank you.
Comment 10 Gaute Hope 2013-07-26 09:05:29 UTC
Yes, applied.

Thanks for figuring this out. Gaute