嵌入式系統(tǒng)多語言文本解決方案
#define TXT_FILE_VIETNAM config/Vietnam.cfg
#define TXT_FILE_SWIDISH config/Swedish.cfg
#define TXT_FILE_POLISH config/Polish.cfg
//根據(jù)文本索引及文本語言,讀取相應的文本配置文件,以得到該文本,成功返回有效指針
GUISTRING * GetTextResource(LONG lIndex, LONG lLanguage)
{
GUISTRING * pTxt;
APPTEXT_FILEHEADER fh;
APPTEXT_MAPPING map;
STRING strFile;
WORD * pBuf;
int fd, iOff;
//確定要讀取的配置文件
switch (lLanguage)
{
case TXT_LANG_ENGLISH:
strFile = TXT_FILE_ENGLISH;
break;
case TXT_LANG_CHINASIM:
strFile = TXT_FILE_CHINASIM;
break;
case TXT_LANG_CHINATRA:
strFile = TXT_FILE_CHINATRA;
break;
case TXT_LANG_KOREAN:
strFile = TXT_FILE_KOREAN;
break;
case TXT_LANG_JAPANESE:
strFile = TXT_FILE_JAPANESE;
break;
case TXT_LANG_SPANISH:
strFile = TXT_FILE_SPANISH;
break;
case TXT_LANG_RUSSIAN:
strFile = TXT_FILE_RUSSIAN;
break;
case TXT_LANG_THAI:
strFile = TXT_FILE_THAI;
break;
case TXT_LANG_GERMAN:
strFile = TXT_FILE_GERMAN;
break;
case TXT_LANG_FRANCE:
strFile = TXT_FILE_FRANCE;
break;
case TXT_LANG_ITALY:
strFile = TXT_FILE_ITALY;
break;
case TXT_LANG_ARABIA:
strFile = TXT_FILE_ARABIA;
break;
case TXT_LANG_PORTUGAL:
strFile = TXT_FILE_PORTUGAL;
break;
case TXT_LANG_HINDI:
strFile = TXT_FILE_HINDI;
break;
case TXT_LANG_TURKISH:
strFile = TXT_FILE_TURKISH;
break;
case TXT_LANG_VIETNAM:
strFile = TXT_FILE_VIETNAM;
break;
case TXT_LANG_SWIDISH:
strFile = TXT_FILE_SWIDISH;
break;
case TXT_LANG_POLISH:
linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)
評論