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 763056 - The whole application translated to Hebrew but appear in English
The whole application translated to Hebrew but appear in English
Status: RESOLVED FIXED
Product: hitori
Classification: Applications
Component: General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: hitori-maint
hitori-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-03 19:30 UTC by Yosef Or Boczko
Modified: 2016-03-04 00:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yosef Or Boczko 2016-03-03 19:30:40 UTC
The whole application are translated to Hebrew[1] but still
appear in English (but the interface is from right to left as
it should be in Hebrew).

[1] https://git.gnome.org/browse/hitori/tree/po/he.po
Comment 1 Michael Catanzaro 2016-03-03 20:07:34 UTC
Didn't this work in the past?
Comment 2 Matthias Clasen 2016-03-03 20:31:16 UTC
The problem is that you use gettext from constructed without explicitly calling setlocale. GtkApplication _will_ call gtk_init (and thus setlocale) for you, but only from startup(), which is much later than constructed.

This causes glib to determine and remember that it should not translate anything because some translations are missing.

Putting a setlocale call early in constructed should fix it
Comment 3 Philip Withnall 2016-03-03 20:43:31 UTC
(In reply to Matthias Clasen from comment #2)
> The problem is that you use gettext from constructed without explicitly
> calling setlocale. GtkApplication _will_ call gtk_init (and thus setlocale)
> for you, but only from startup(), which is much later than constructed.
> 
> This causes glib to determine and remember that it should not translate
> anything because some translations are missing.
> 
> Putting a setlocale call early in constructed should fix it

Nope, the path being passed to bindtextdomain() was wrong, so gettext was looking for translations in the wrong place.

Fixed.

commit b91ab2d3aed8429774439edc92b3ce90cddf60ec
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Thu Mar 3 20:39:21 2016 +0000

    build: Fix definition of PACKAGE_LOCALE_DIR
    
    This is passed to bindtextdomain() to allow it to find translations, so
    needs to be correct for translations to work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763056

 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Michael Catanzaro 2016-03-04 00:07:33 UTC
I think startup is too late to initialize translations, because then the help for the command line options doesn't get translated. We normally do this in main, before creating the GtkApplication, but it's good to know constructed works too.