Re: gettext and utf-8 in Gnome 2



An, 2001-11-27 16:52, Carlos Perelló Marín rašė:
> El mar, 27-11-2001 a las 15:08, Gediminas Paulauskas escribió:
> > In Gtk+ 2 all user-visible text is in Unicode. This includes
> > translations which come from po files. There are two ways to achieve
> > this:
> > 
> > bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
> > bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");  /* add this call */
> > textdomain (GETTEXT_PACKAGE);
> > 
> > or force all po files to be in utf-8.
> 
> 
> This is not correct.
> 
> I was playing with this && glade2 some weeks ago and it's only true for
> glibc <= 2.1 (I think).
> 
> The glibc >= 2.2 recode your .po catalog to the locale you have ser at
> LC_*.

[ skip example ]
 
> So, If we want that all users get the correct strings we MUST use
> bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
> We cannot set it's locale to LOCALE.UTF-8 (for example all gdm2 for
> GNOME 1.4 versions will show wrong strings in GNOME 2.0 applications)

So, as it turned out, every application and library, which manipulates
or displays translated strings, must call this.

I have done that change for all apps in gnome-games and gnome-core
yesterday. Can I continue to do similar fixes for other modules?

> > There are other things which work with the same translation, namely:
> > 
> > 1. intltool
> > 2. libglade
> > 3. libbonoboui
> > 
> > intltool reads various text files, and adds translatable strings to pot
> > file. Later libglade (.glade2 files) and libbonoboui (.xml files) call
> > gettext for these strings to get translations. They use dgettext
> > (domain, string) for that. But they do not call bind_textdomain_codeset
> > (), so get translations in the codeset which po file is saved in.

so libglade is correct. I haven't looked at any app which uses
libbonoboui yet.

> All apps && libraries MUST call bind_textdomain_codeset to work ok with
> glibc >= 2.2 and also, translators must convert their translations to
> utf-8 to get them ok with glibc < 2.2

So it's not that neccessary to convert the po files... let the
translators do that, if it's not causing problems for them (i.e. editing
utf-8 files in vim is problematic).

-- 
Gediminas Paulauskas
Kaunas, Lithuania



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]