Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

View: New views
5 Messages — Rating Filter:   Alert me  

Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

by Ali Abdallah-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Reported by Hashimoto against Parole, but i just realize that other
packages are affected too (Terminal for example).

Steps:
1) Set locale to let's say fr_FR.utf8
2) Open Terminal or Parole...
3) Open the about dialog
4) Reopen the preferences dialog (or any dialog constructed by
GtkBuilder in the application).

Result:
Strings are displayed in English.

It took me a lot of time to figure out that the thing is XFCE_LICENSE_*
is calling xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, NULL);
but for some reason it is messing up with locale domain of the package
itself.

Disabling the call in libxfce4util or calling xfce_textdomain
(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); again after closing the dialog
fixes the problem, no idea why.

Please your comments.

Ali.
_______________________________________________
Xfce mailing list
Xfce@...
http://foo-projects.org/mailman/listinfo/xfce
http://www.xfce.org

Re: Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

by Christoph Wickert-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Dienstag, den 20.10.2009, 23:40 +0200 schrieb Ali Abdallah:

> Disabling the call in libxfce4util or calling xfce_textdomain
> (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); again after closing the dialog
> fixes the problem, no idea why.
>
> Please your comments.

I reported a similar problem with Terminal 0.4.x (#5842) and the fix was
trivial:
http://git.xfce.org/apps/terminal/commit/?id=5c955bb0435dca6d7114903d246cf2e4a215cc5e

> Ali.

Regards,
Christoph

_______________________________________________
Xfce mailing list
Xfce@...
http://foo-projects.org/mailman/listinfo/xfce
http://www.xfce.org

Re: Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

by Brian J. Tarricone-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 20, 2009 at 17:08, Christoph Wickert
<christoph.wickert@...> wrote:

> Am Dienstag, den 20.10.2009, 23:40 +0200 schrieb Ali Abdallah:
>
>> Disabling the call in libxfce4util or calling xfce_textdomain
>> (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); again after closing the dialog
>> fixes the problem, no idea why.
>>
>> Please your comments.
>
> I reported a similar problem with Terminal 0.4.x (#5842) and the fix was
> trivial:
> http://git.xfce.org/apps/terminal/commit/?id=5c955bb0435dca6d7114903d246cf2e4a215cc5e

That's really a poor fix.  Libraries shouldn't be calling
xfce_textdomain().  They should include glib/gi18n-lib.h (instead of
glib/gi18n.h), which sets up the _() macro in such a way that it
passes GETTEXT_PACKAGE when making the gettext calls.  The i18n stuff
in libxfce4util probably isn't the best idea for libraries.

     -brian
_______________________________________________
Xfce mailing list
Xfce@...
http://foo-projects.org/mailman/listinfo/xfce
http://www.xfce.org

Re: Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

by Nick Schermer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/21 Brian J. Tarricone <brian@...>:

> On Tue, Oct 20, 2009 at 17:08, Christoph Wickert
> <christoph.wickert@...> wrote:
>> Am Dienstag, den 20.10.2009, 23:40 +0200 schrieb Ali Abdallah:
>>
>>> Disabling the call in libxfce4util or calling xfce_textdomain
>>> (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); again after closing the dialog
>>> fixes the problem, no idea why.
>>>
>>> Please your comments.
>>
>> I reported a similar problem with Terminal 0.4.x (#5842) and the fix was
>> trivial:
>> http://git.xfce.org/apps/terminal/commit/?id=5c955bb0435dca6d7114903d246cf2e4a215cc5e
>
> That's really a poor fix.  Libraries shouldn't be calling
> xfce_textdomain().  They should include glib/gi18n-lib.h (instead of
> glib/gi18n.h), which sets up the _() macro in such a way that it
> passes GETTEXT_PACKAGE when making the gettext calls.  The i18n stuff
> in libxfce4util probably isn't the best idea for libraries.

It was the best fix, without touching libxfce4util. So can we remove
the internal
_xfce_i18n_init call without problems? I was not sure about that since the
PACKAGE_LOCALE_DIR might be in another location.

Nick
_______________________________________________
Xfce mailing list
Xfce@...
http://foo-projects.org/mailman/listinfo/xfce
http://www.xfce.org

Re: Localization lost in GtkBuilder interface file when using XFCE_LICENSE_*

by Brian J. Tarricone-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 01:41, Nick Schermer <nickschermer@...> wrote:

> It was the best fix, without touching libxfce4util. So can we remove
> the internal
> _xfce_i18n_init call without problems?

No, that'll break things.  You need to make sure the _() macro is
being set to the one that passes GETTEXT_PACKAGE along with the string
to be translated.

Actually, I think we might need to leave the _xfce_i18n_init() call.
It shouldn't break anything, though... I'm not sure why the change
talked about higher in the thread was needed.

I don't really have time to look into this, so either leave it as is
or do some testing with various combinations.

     -brian
_______________________________________________
Xfce mailing list
Xfce@...
http://foo-projects.org/mailman/listinfo/xfce
http://www.xfce.org