Re: local problem in developing GUI
From: Roger Leigh (${roger}_at_invalid.whinlatter.uklinux.net.invalid)
Date: 12/01/04
- Next message: Arron: "Re: local problem in developing GUI"
- Previous message: Arron: "local problem in developing GUI"
- In reply to: Arron: "local problem in developing GUI"
- Next in thread: Arron: "Re: local problem in developing GUI"
- Reply: Arron: "Re: local problem in developing GUI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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-----
- Next message: Arron: "Re: local problem in developing GUI"
- Previous message: Arron: "local problem in developing GUI"
- In reply to: Arron: "local problem in developing GUI"
- Next in thread: Arron: "Re: local problem in developing GUI"
- Reply: Arron: "Re: local problem in developing GUI"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|