Re: HIS etc [WAS: [ANNOUNCE] GNUmed 0.2 release]
On Tue, Sep 12, 2006 at 12:41:12PM +0100, Adrian Midgley wrote:
> Can you give a pointer to the Debian systems for internationalising
> packages and software, please?
Debian has a community which takes care of i18ning the
distribution itself: the installer, the websites, the
package installation instructions etc. In some places this
goes so far as to translate in-package descriptions or even
program strings. The latter is rare and, of course, up to
the discretion of anyone who does it.
For example, GNUmed has gained Swedish, Czech (and some
other) package installation support in no time without me
even looking. On Debian, that is.
> I know there are ways to make software with the language strings
> separate from the code, so that a new set of strings can just be dropped
> in for a new language, but I'm not clear on what they are or how they work.
In a simple one-language program the programmer would code:
print 'How are you ?'
which would *always* print "How are you?" to the screen, no
matter where it is run. In a i18ned application the
programmer would write:
print _('How are you?')
Now, there are several steps:
1) Before release a program looks at all the source code and
extracts the strings wrapped in _().
2) Those are put into a file for translation.
3) There is one such file per language.
4) When the program is later run it uses 'How are you?' as
a key into a dictionary of translated strings.
5) If it finds the key it prints the corresponding translation.
6) If it does not it prints the (englisch) original string.
*Which* language file to look in is defined at program
start. Usually the software will know from your desktop
environment language.
If you want to add a new language you just translate the
strings, drop in the file with the translations and tell the
program to use that language.
GNUmed has full Englisch/German support. Rudimentary French
and Spanish are there, too. Anyone interested in translation
just drop me a line.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
Reply to: