[openbeos] Re: Coding Guidelines, translations

  • From: "Daniel Reinhold" <danielr@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Fri, 09 Nov 2001 04:36:29 CST

>To make it easier with translating the applications, I've taken the 
>habit to use a macro called =5FT. I use this macro as follows:
>       printf(=5FT("Hello Dear %s"), name);
>To make it easier to replace all literal strings with calls to 
>translation libraries. Until we choose one however, we can do:
>#define =5FT(str) (str)
>and have no code generated for this. Is this an idea to include in the 
>coding guidelines=3F

Is that how we are going to handle translations -- thru a function call 
each time literal text is displayed? That would work, of course, but I 
think it would be better if we put all the display strings into 
resources. Then we would be able to compile different distros with 
different language resources: a Spanish distro, a French distro, a 
German distro, etc. Each of these would be identical except for the 
string resources included. Does anyone else agree?

Even doing it the way I suggest, it would still be useful to markup the 
source code as Ithamar has suggested so that it would be easier to 
create the string resources later (no reason for devs to worry creating 
string resources until a module is basically finished). But perhaps it 
would be better to use a slightly longer macro name, for example 
"_DT()" for "display text" or even "_DMSG()" for "display message". 
Naturally, only string literals that are being displayed for the user 
to read would need to be marked up like this.

Other related posts: