Re: Language Selcection Philosophy



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/>


.



Relevant Pages

  • Re: Multi-Language Site
    ... a meaningfull string would be a better option IMO, ... GetTrans(StringId, LanguageId) function, to fetch the wanted translated ... and also request them by page (less data to request = ... you might consider storing all translation data in the Application ...
    (microsoft.public.inetserver.asp.db)
  • Re: Which is this sentence
    ... But in order to achieve this translation ... is objectionable in NAFL). ... This superposition state is similar to the Schrodinger cat's ... Now define the "fixed point term" for any string S to be ...
    (sci.logic)
  • Re: Anyone wanna help with a compression routine (new type)
    ... Pi is an infinite pseudorandom string. ... we know: For every language a part of at least 1 ... The problem is an important one as the compression of an algorithm ... translation by having a language pair. ...
    (sci.math.research)
  • Re: Saving strings to ini file
    ... My test app creates data like this: ... > other string constants, things normally declared like ... A class that encapsulates translation behavior works for me. ... string; replacements ...
    (alt.comp.lang.borland-delphi)
  • Compile-time text/string manipulation
    ... A "compile-time language" is one that processes ... Compile time languages for assemblers ... This group includes macro ... requires access to various string and text manipulation ...
    (alt.lang.asm)