Re: Language Selcection Philosophy
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 05 May 2006 12:20:57 -0400
Hans-Bernhard Broeker wrote:
.... snip ...
Not necessarily. This is the general approach of GNU gettext, with
the additional feature that the string tables are actually stored in
separate files, not inside the program. This would obviously have to
be reconsidered for small embedded systems that don't use file
systems.
The basic idea is that each string literal is replaced by a call to
a macro named '_', i.e. you would write:
puts(_("This is some message"));
A utility extracts all these from the source and builds a "translation
input file". If necessary, this can have comments to guide the
translators. Eventually, each translator translates all these
messages, and the resulting translation table is compiled into a
"message catalog" file. In the actual code, the _() macro invocations
are expanded to call the gettext() function that gets the strings from
that table.
Sounds very like the system I described elsethread, and that I
independently developed about 1998 for a PPOE. Great minds think
alike :-). I even used the same _(), but it was not a macro.
In my case the motivation was different. The need was to reduce
the loaded program size by banishing the strings to a separate
file, and the easy language translation was a side-effect. However
the operation was probably similar. Write the sources, create a
master filelist control file, and run the suite. Then compile
normally. It could all be wrapped up in the makefile.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
.
- References:
- Language Selcection Philosophy
- From: Tom Lucas
- Re: Language Selcection Philosophy
- From: Hans-Bernhard Broeker
- Language Selcection Philosophy
- Prev by Date: Anyone have experience with the Aardvark I2C bus host adapter
- Next by Date: Re: What is the function of Loader in Build process(tool chain)?
- Previous by thread: Re: Language Selcection Philosophy
- Next by thread: Re: Language Selcection Philosophy
- Index(es):
Relevant Pages
|