Re: local problem in developing GUI

From: Roger Leigh (${roger}_at_invalid.whinlatter.uklinux.net.invalid)
Date: 12/01/04


Date: Wed, 01 Dec 2004 14:38:25 +0000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

jianju.ee@polyu.edu.hk (Arron) writes:

> I have been using RH Linux 9 (Chinese version) for some time, but I
> met some problems when developing GUI software for English Linux OS.

There are not different versions of Linux for different languages.
Linux is fully internationalised, so one system can handle *all*
languages.

Internationalisation takes place at the level of the C library, where
locales are used to define program behaviour in different localities,
which is set by environment variables. This controls the output
character set, sorting and collation, date and monetary formatting
etc. On top of this gettext is commonly-used to translate program
output into the language specifed by the locale.

What locale and charset are you using:
$locale
$locale -k charmap

> I build GUI by using Glade 2 (with gettext checked) and the menu
> generated including Chinese characters causes display problems in my
> computer. How can I solve this problem so that all of Glade displays
> only English? Someone tells me that gtranslator can be of help to my
> problem, but how should I use this software? Thank you in advance.

Make sure the Glade interface is created with all the translatable
strings written in English (not required, but it will make things
simpler). Make sure you restrict yourself to US-ASCII characters
(again, not required, but it makes things simpler).

You now need to run xgettext to extract the translatable strings and
put them in a .pot file. If you've properly gettextized your source
tree, edit po/POTFILES.in and add the message files you asked Glade to
create (1 per .glade file).

Next, copy the .pot file po/$PACKAGE.pot to e.g. po/zh_HK.po. This
file is the one which translates the English strings to Chinese. Make
sure you set the encoding to UTF-8 (not required, but it makes things
easier since GTK+ uses UTF-8 throughout). Edit this file with
GTranslator or Emacs po-mode (I prefer the latter). Add the
translation zh_CN to the ALL_LINGUAS variable in configure.ac.

Build and install; you should have a po/zh_HK.mo file installed under
/usr/share/locale/zh_HK/LC_MESSAGES/, which will be installed if
LANG=zh_HK in your environment.

If you are unsure why I suggested these steps, check out the GNU
gettext manual.

Regards,
Roger

- --
Roger Leigh
                Printing on GNU/Linux? http://gimp-print.sourceforge.net/
                Debian GNU/Linux http://www.debian.org/
                GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFBrddeVcFcaSW/uEgRAiAyAKDtAOcM/9xK9aLRfOlnCZfu9wYGaACgnDgd
Xa/K3CrRleNupeBUAQJ9EYI=
=ABHP
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: The proto-religion of the PIE
    ... languages, some are superior like the Sanskrit-derived modern Bengali ... and others like English are inferior. ... Shakespeare, Shelley) into Bengali, just as it is easy to translate ...
    (sci.lang)
  • Re: local problem in developing GUI
    ... Does that mean I don't have to care about the language problems in the ... >> met some problems when developing GUI software for English Linux OS. ... On top of this gettext is commonly-used to translate program ... >output into the language specifed by the locale. ...
    (comp.os.linux.development.apps)
  • Re: localization: What is a language
    ... > English if a program doesn't provide for those languages. ... > that if a program has no Serbian support but does have Croatian then it ... the locale system in Linux falls back to ...
    (comp.os.linux)
  • Re: I am a linguist from China
    ... I am a linguist from China, I could speak 7 languages besides my ... translate something from English to German which had first been ... So let's communicate. ... but imagine having to translate this into any other ...
    (sci.lang.translation)
  • Re: Delphi 2006 - How about a Multilingual DVD Release?
    ... > be called) on DVD in all Languages - at least in Europe. ... > I think you should include German, French and English Versions. ... Examples could be Spanish, ... i would gladly help to translate the IDE and help to Spanish. ...
    (borland.public.delphi.non-technical)