Re: Unicode and GTK



"Eric Openshaw" <erico tnarobag com> writes:
>  
> 
> I am writing an app using gtk (gtkmm-1.2.5,gtk+-1.2.8 to be precise) which I want to make
> multilingual - namely the labels and buttons.  I have looked through many archives for
> hints on how to do this, and have understood the following (I
> think):

You are better off just looking at examples of other apps, most likely.

> - unicode would be the best way to go since I am looking at using about 12 languages (I
> understand this as meaning UTF8 locales and fonts)

You can't meaningfully use Unicode, no. GTK 1.2 can't do anything with Unicode.

> - if I set the shell loacle to a CJK (export LANG=ja_JP.UTF8 for example), and set the
> set_locale to true in the constructor for Gtk::Main, the labels should be interpreted as
> an array of 2 byte chars.

The labels will be in locale encoding. (For LANG=ja_JP.UTF8 this is an
array of variable-length characters, not two byte characters. But no
one much uses ja_JP.UTF8 I don't think.)

> -as well as this I need to have glibc-2.2 or higher (1) for this interpretation to take
> place, and (2) to create the UTF8 locales (using localedef ...).

Nah, you don't need to worry about libc2.2; because you don't care if
the locale is UTF8 or not. Your app should work with any encoding if
you're using the locale model and GTK 1.2.

> As a result I have been tyring to build and install glibc-2.2.2 and
> feel that I am in well over my head - I've only been using linux for
> a few months. 

I've been using Linux for years and that would be over my
head. Changing the distribution-shipped libc == Bad Idea.
 
> Is there an easier way, or perhaps have I misunderstood the way to go about it?? 

Yes, I think you are overcomplicating things. 

Just mark strings for translation using gettext(); translators will do
their translation in the right encoding for the locale; pass the
translated strings to GTK; it will all just work.

Havoc




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