|
From: Theo V. <The...@le...> - 2001-12-11 13:57:26
|
"S. Ancelot" wrote: > > We solved this problem (Windows and unix) using runtime loading as follow : > > 1) A text file contains all text messages as follow in the preferred language : > "english.txt" > 0:text 1 > [st_texte_1] > 1:Yes > [st_es] > > 2) A task loads this file in a shared memory area once, and compacts it. > you have only to load the right text file (english,french...) > 3) each program using language texts will link to this shared area at startup > 4) a C++ description file allows a link from the text file to shared memory ptr : > "langue.h" file : > #define st_texte_1 mess[0] > #define st_yes mess[1] > . > . > . > > 4) in the C++ code, to use it : > #include "langue.h" -> text - ptr definition > > #include "init_mess.h" -> API that links to the shared memory ptr > > // enjoy using texts > printf(st_texte_1); .... > > Advantages : > Texts are not duplicated in each files, since they are stored in a shared memory > area. > Easy to use , e.g. to add a text : > a)add the text to each language dependent text file. > b) setup the ptr number in the langue.h file, > c) use it in your program ! > > It works, we did it ! I believe you it works. But what happens if the message file isn't found or doesn't match the one expected by the program or library. With all due respect don't you agree we need absolutely fail safe message lookup handling? Also IMHO I don't think the message lookup 'problem' should be attacked seperately from other i18n issues. But I may be alone here. Regards, Theo |