Problem with localization of gtk stock button text

216 views
Skip to first unread message

L18L

unread,
Aug 8, 2011, 12:44:48 PM8/8/11
to yad-common
Hi Viktor,

thank you for this wonderful yad.

There is just one strange issue with internationalization.

#LANGUAGE=de yad

shows yad containing the button "Cancel" correctly translated to
German "Abbrechen".

Now I have tried another language (gtk.mo installed for Netherlands).

Example:
#LANGUAGE=nl yad
is showing the untranslated buttons.

Have I been missung something?
Or what do you think about this for me unexpected behavior?

Thanks in advance

L18L
http://www.murga-linux.com/puppy/viewtopic.php?t=69283&start=48



L18L

unread,
Aug 8, 2011, 12:55:01 PM8/8/11
to yad-common
Sorry, above was meant to be.

gtk20.mo

Victor Ananjevsky

unread,
Aug 9, 2011, 2:31:48 AM8/9/11
to yad-c...@googlegroups.com
On Mon, 8 Aug 2011 09:44:48 -0700 (PDT)
L18L <u.ri...@web.de> wrote:

> Hi Viktor,
>
> thank you for this wonderful yad.
>
> There is just one strange issue with internationalization.
>
> #LANGUAGE=de yad
>
> shows yad containing the button "Cancel" correctly translated to
> German "Abbrechen".
>
> Now I have tried another language (gtk.mo installed for Netherlands).
>
> Example:
> #LANGUAGE=nl yad
> is showing the untranslated buttons.

do you build this locale? e.g. do something like this - localedef -i nl_NL -f UTF-8 nl

>
> Have I been missung something?
> Or what do you think about this for me unexpected behavior?
>
> Thanks in advance
>
> L18L
> http://www.murga-linux.com/puppy/viewtopic.php?t=69283&start=48
>
>
>


--
Victor Ananjevsky <anan...@gmail.com>

L18L

unread,
Aug 9, 2011, 3:57:46 AM8/9/11
to yad-common
# yad --version
0.12.4
# locale -a
C
de_DE.utf8
de-DE.utf8
en_US
nl_NL.utf8
POSIX
uk_UA.utf8
# echo $LANG
nl_NL.UTF-8
#
Same behavior: It is always just German translated.

I don't think it is related to my puppy linux OS.

If anyone interested in internationalization would report success in
getting translated "Quit" on any other system that would be great!


Maybe it is the different UTF-8 and utf8 ?
Or no problem in gtk30 ?
Or no problem in latest yad ?

My regards
L18L
> Victor Ananjevsky <anana...@gmail.com>

Victor Ananjevsky

unread,
Aug 9, 2011, 12:34:53 PM8/9/11
to yad-c...@googlegroups.com
On Tue, 9 Aug 2011 00:57:46 -0700 (PDT)
L18L <u.ri...@web.de> wrote:

> # yad --version
> 0.12.4
> # locale -a
> C
> de_DE.utf8
> de-DE.utf8
> en_US
> nl_NL.utf8
> POSIX
> uk_UA.utf8
> # echo $LANG
> nl_NL.UTF-8
> #
> Same behavior: It is always just German translated.
>

i don't know how to gtk+ or gettext supports LANGUAGE variable. can you try to redefine LANG or LC_MESSAGES? and what to say "echo $LC_ALL"? this variable must be unset, because LC_ALL replace any of LANG, LANGUAGE and LC_* values

> I don't think it is related to my puppy linux OS.
>
> If anyone interested in internationalization would report success in
> getting translated "Quit" on any other system that would be great!
>
>
> Maybe it is the different UTF-8 and utf8 ?
> Or no problem in gtk30 ?
> Or no problem in latest yad ?
>
> My regards
> L18L
>

> On Aug 9, 8:31О©Ґam, Victor Ananjevsky <anana...@gmail.com> wrote:
> > On Mon, 8 Aug 2011 09:44:48 -0700 (PDT)
> >
> >
> >
> > L18L <u.rin...@web.de> wrote:
> > > Hi Viktor,
> >
> > > thank you for this wonderful yad.
> >
> > > There is just one strange issue with internationalization.
> >
> > > #LANGUAGE=de yad
> >
> > > shows yad containing the button "Cancel" correctly translated to
> > > German "Abbrechen".
> >
> > > Now I have tried another language (gtk.mo installed for Netherlands).
> >
> > > Example:
> > > #LANGUAGE=nl yad
> > > is showing the untranslated buttons.
> >
> > do you build this locale? e.g. do something like this - localedef -i nl_NL -f UTF-8 nl
> >
> >
> >
> > > Have I been missung something?
> > > Or what do you think about this for me unexpected behavior?
> >
> > > Thanks in advance
> >
> > > L18L
> > >http://www.murga-linux.com/puppy/viewtopic.php?t=69283&start=48
> >
> > --

> Delivered-To: anan...@gmail.com
> Receiv

--
Victor Ananjevsky <anan...@gmail.com>

L18L

unread,
Aug 9, 2011, 4:08:34 PM8/9/11
to yad-common

$LC_ALL and $LC_MESSAGES are not set.

If I include
export LC_MESSAGES=de
in my code then and I get

(process:6834): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.

and of course no more German.
--------

Viktor, I don't want to annoy you with the maybe very special settings
of puppy linux!
I have no other system. I remember in SuSE one could easy switch
between several languages.

But if you can you produce a simple translated gtk-quit
in a language other than English or German
I would be happy.

My regards
L18L
> > On Aug 9, 8:31 am, Victor Ananjevsky <anana...@gmail.com> wrote:
> > > On Mon, 8 Aug 2011 09:44:48 -0700 (PDT)
>
> > > L18L <u.rin...@web.de> wrote:
> > > > Hi Viktor,
>
> > > > thank you for this wonderful yad.
>
> > > > There is just one strange issue with internationalization.
>
> > > > #LANGUAGE=de yad
>
> > > > shows yad containing the button "Cancel" correctly translated to
> > > > German "Abbrechen".
>
> > > > Now I have tried another language (gtk.mo installed for Netherlands).
>
> > > > Example:
> > > > #LANGUAGE=nl yad
> > > > is showing the untranslated buttons.
>
> > > do you build this locale? e.g. do something like this - localedef -i nl_NL -f UTF-8 nl
>
> > > > Have I been missung something?
> > > > Or what do you think about this for me unexpected behavior?
>
> > > > Thanks in advance
>
> > > > L18L
> > > >http://www.murga-linux.com/puppy/viewtopic.php?t=69283&start=48
>
> > > --
> > Delivered-To: anana...@gmail.com
> > Receiv
>
> --
> Victor Ananjevsky <anana...@gmail.com>

Slavko

unread,
Aug 10, 2011, 3:16:32 AM8/10/11
to yad-c...@googlegroups.com
Hi,

Dňa Tue, 9 Aug 2011 13:08:34 -0700 (PDT) L18L <u.ri...@web.de> napísal:

>
> $LC_ALL and $LC_MESSAGES are not set.
>
> If I include
> export LC_MESSAGES=de
> in my code then and I get
>
> (process:6834): Gtk-WARNING **: Locale not supported by C library.
> Using the fallback 'C' locale.

My locale settings

LANG=sk_SK.utf8
LANGUAGE=sk_SK.UTF-8:sk:cs
...
LC_MESSAGES="sk_SK.utf8"

Here are different methods:

yad
- localization OK, no Gtk-WARNING

LANGUAGE=sk_SK.UTF-8 yad
- localization OK, no Gtk-WARNING

LANGUAGE=sk_SK yad
- localization OK, no Gtk-WARNING

LANGUAGE=sk yad
- localization OK, no Gtk-WARNING

LANG=sk yad
(process:5179): Gtk-WARNING **: Locale not supported by C library.


Using the fallback 'C' locale.

- no localization, Gtk-WARNING

LANG=sk_SK yad
(process:5191): Gtk-WARNING **: Locale not supported by C library.


Using the fallback 'C' locale.

- no localization, Gtk-WARNING

LANG=sk_SK.UTF-8 yad
- localization OK, no Gtk-WARNING

Setting the LANG variable must to set the LC_MESSAGES too...

The LANGUAGE property is not POSIX, only GNU extension and not all
programs uses this variable, but gettext yes.

Try experiment with full locale's name and for details try ask the GTK'
people, while the WARNING is from GTK, and not from YAD :-)

regards

--
s pozdravom

Slavko
http://slavino.sk

signature.asc

L18L

unread,
Aug 10, 2011, 4:37:19 AM8/10/11
to yad-common
Hi Slavko,

thank you very much for your feedback.

Yes, I have been experimenting, but with LANGUAGE !
And I can report success.

# echo $LANG
de_DE.UTF-8
#

#LANGUAGE=nl:de

is showing correct translation of gtk-quit to nl
(gtk20 loaded for nl)

and
#LANGUAGE=zh:de

is showing correct translation of gtk-quit to de
(gtk20 NOT loaded for zh)

... and I am glad that it was no fault of yad or gtk
just missing some HOWTO use it...
and I am hoping I have contributed something useful for others.

My regards



On 10 Aug., 09:16, Slavko <slav...@slavino.sk> wrote:
> Hi,
>
> Dňa Tue, 9 Aug 2011 13:08:34 -0700 (PDT) L18L <u.rin...@web.de> napísal:
>  signature.asc
> < 1 KBAnzeigenHerunterladen

Slavko

unread,
Aug 10, 2011, 4:56:29 AM8/10/11
to yad-c...@googlegroups.com
Hi,

Dňa Wed, 10 Aug 2011 01:37:19 -0700 (PDT) L18L <u.ri...@web.de> napísal:

> ... and I am glad that it was no fault of yad or gtk
> just missing some HOWTO use it...

I disbelieve that there is not some HOWTO or tutorial for your language,
try find some pages (resources) from your lanaguage localization teams.
(KDE, GNOME, translation-project, etc). Or try search your distro pages.

I repeat, the LANGUAGE is not POSIX variable, but GNU extensions, followed
by gettext, but not followed in KDE, Qt and possible others localization
systems. Therefore setting this variable needn't to work all time, for all
programs. Default localization's variables are LANG and LC-*, but these
can't have more than one language.

For example, the GDM(3?) on Debian resets this variable to user's language
selected while login (only one).

signature.asc

L18L

unread,
Aug 10, 2011, 8:19:44 AM8/10/11
to yad-common
Hi,
> I repeat, the LANGUAGE is not POSIX variable, but GNU extensions, followed
> by gettext, but not followed in KDE, Qt and possible others localization
> systems. Therefore setting this variable needn't to work all time, for all
> programs. Default localization's variables are LANG and LC-*, but these
> can't have more than one language.
I don't care about POSIX.

My program does not need to work in KDE, Qt... just in GNU gettext
Yes, LANG is localization: Date format, currency,...
But this is about languages not bound to locations

There are some countries where more than 1 language is used.
And there are users who use more then 1 language...

Binding just ONE language to a LOCALE
and not allowing other languages is a poor design.

So GNU gettext LANGUAGE is better for my purposes.

Regards

On 10 Aug., 10:56, Slavko <slav...@slavino.sk> wrote:
> Hi,
>
> Dňa Wed, 10 Aug 2011 01:37:19 -0700 (PDT) L18L <u.rin...@web.de> napísal:

Victor Ananjevsky

unread,
Aug 10, 2011, 1:21:24 PM8/10/11
to yad-c...@googlegroups.com
On Wed, 10 Aug 2011 05:19:44 -0700 (PDT)
L18L <u.ri...@web.de> wrote:

> Hi,
> > I repeat, the LANGUAGE is not POSIX variable, but GNU extensions, followed
> > by gettext, but not followed in KDE, Qt and possible others localization
> > systems. Therefore setting this variable needn't to work all time, for all
> > programs. Default localization's variables are LANG and LC-*, but these
> > can't have more than one language.
> I don't care about POSIX.
>
> My program does not need to work in KDE, Qt... just in GNU gettext
> Yes, LANG is localization: Date format, currency,...
> But this is about languages not bound to locations
>
> There are some countries where more than 1 language is used.
> And there are users who use more then 1 language...
>
> Binding just ONE language to a LOCALE
> and not allowing other languages is a poor design.
>
> So GNU gettext LANGUAGE is better for my purposes.

maybe. but not better for your test examples.
a simple quote from locale(7)

LC_MESSAGES
changes the language messages are displayed in and what an affirmative or negative answer
looks like. The GNU C-library contains the gettext(3), ngettext(3), and rpmatch(3) func‐
tions to ease the use of these information. The GNU gettext family of functions also
obey the environment variable LANGUAGE (containing a colon-separated list of locales) if
the category is set to a valid locale other than "C".


so preferable way is using LC_* variables

>
> Regards
>
> On 10 Aug., 10:56, Slavko <slav...@slavino.sk> wrote:
> > Hi,
> >
> > Dňa Wed, 10 Aug 2011 01:37:19 -0700 (PDT) L18L <u.rin...@web.de> napísal:
> >
> > > ... and I am glad that it was no fault of yad or gtk
> > > just  missing some HOWTO use it...
> >
> > I disbelieve that there is not some HOWTO or tutorial for your language,
> > try find some pages (resources) from your lanaguage localization teams.
> > (KDE, GNOME, translation-project, etc). Or try search your distro pages.
> >
> > I repeat, the LANGUAGE is not POSIX variable, but GNU extensions, followed
> > by gettext, but not followed in KDE, Qt and possible others localization
> > systems. Therefore setting this variable needn't to work all time, for all
> > programs. Default localization's variables are LANG and LC-*, but these
> > can't have more than one language.
> >
> > For example, the GDM(3?) on Debian resets this variable to user's language
> > selected while login (only one).
> >
> > --
> > s pozdravom
> >
> > Slavkohttp://slavino.sk
> >
> >  signature.asc

> Delivered-To: ananasik@gmail.

--
Victor Ananjevsky <anan...@gmail.com>

Victor Ananjevsky

unread,
Aug 10, 2011, 1:30:57 PM8/10/11
to yad-c...@googlegroups.com
On Tue, 9 Aug 2011 13:08:34 -0700 (PDT)
L18L <u.ri...@web.de> wrote:

>
> $LC_ALL and $LC_MESSAGES are not set.
>
> If I include
> export LC_MESSAGES=de
> in my code then and I get
>
> (process:6834): Gtk-WARNING **: Locale not supported by C library.
> Using the fallback 'C' locale.
>
> and of course no more German.
> --------
>
> Viktor, I don't want to annoy you with the maybe very special settings
> of puppy linux!
> I have no other system. I remember in SuSE one could easy switch
> between several languages.
>
> But if you can you produce a simple translated gtk-quit
> in a language other than English or German
> I would be happy.
>

there is gtk+ problems. i know nothing about translations, except help string for command-line arguments.
this is a gtk+ translation. and it follows gettext's rules. if you have a compiled locale, you get properly translated strings, if not - you haven't.

i don't know, how puppy linux builds locales. especially i use linux from scratch, and build all system by myself, so it is very hard for me to find a problems of special distros. but according to my knowledge, this is a problem of incorrect locale name. try to see /usr/share/locale/aliases and use a proper name

L18L

unread,
Aug 10, 2011, 3:10:28 PM8/10/11
to yad-common
Hi Victor,

thank you very much for your feedback.

I did not find anything about LC_MESSAGES in my system
and for my purpose the solution with LANGUAGE is sufficient.

Simple example to repeat for all yad fans:
--------------

#LANGUAGE=nl:$LANG yad

will show: 'Annuleren' if TEXTDOMAINDIR/nl/LC_MESSAGES/gtk20.mo is
installed

will show: 'Cancel' in the language of your locale
if TEXTDOMAINDIR/nl/LC_MESSAGES/gtk20.mo is
NOT installed
Without :$LANG it is the English fallback 'Cancel'

So this solution is perfect for my purpose:
Showing some messages in different languages
while enabling navigation in the user's language.

If you download from above link: you can just rename the .pet to .tgz

Thanks again for your wonderful yad
L18L
Reply all
Reply to author
Forward
0 new messages