在Symbian中定義本地化文本

Home Home
引用 | 編輯 笑笑
2009-04-23 17:02
樓主
推文 x0
本文編譯自Nokia論壇,並在S60 SDK 5th 0.9 上驗證成功。故將其翻譯成中文和大家分享。

語言的編號定義在e32const.h頭文件中,比如中國的編號是31。首先需要在mmp中定義你組件中的語言:
// file: MyApp.mmp

...

LANG 01 02 16 // UK English, French, Russian
把字符串內容放在不同的語言文本文件之中,注意,如果你要支持非ASCII碼的語言,比如中文。需要在文件頭部寫明。如下所示:
// file: MyApp.l01 (ELangEnglish = 01)

#define message_wait "Please wait..."// file: MyApp.l02 (ELangFrench = 02)

// the file has to be encoded in UTF-8 for the strings to be rendered correctly:
CHARACTER_SET UTF8

#define message_wait "Attendez, s'il-vous plait..."// file: MyApp.l16 (ELangRussian = 16)

// the file has to be encoded in UTF-8 for the strin ..

訪客只能看到部份內容,免費 加入會員



獻花 x0