Symbian中显示中文资源所需要的步骤。
1. MyProject.mmp文件里添加
LANG 01 31
其中,01代表英文,31代表简体中文。
2. MyProject.rss中,添加
#include "MyProject.loc"
MyProject.loc用来存放跟各种语言相关的资源。
3. 创建MyProject.loc文件,我通常的使用方式是将各种语言的资源分放在不同的文件中
// English is the default language(sC) and 01
#ifdef LANGUAGE_01
#include "MyProject.l01"
#endif
// Chinese language resources follow
#ifdef LANGUAGE_31
#include "MyProject.l31"
#endif
其中,MyProject.l01存放英文资源,MyProject.l31存放简体中文资源
4. 创建MyProject.l01,将英文资源的定义放置其中
5. 创建MyProject.l31,在此文件开头加入
CHARACTER_SET UTF8
然后定义中文资源,比如
#define qtn_option_menu_commamd "命令"
MyProject.l31文件需要用Word采用UTF-8编码方式进行保存,此处一定要注意。
charconv -input=gb2312 MyProject.l31 -output=utf8 MyProject.ll,将MyProject.l31删除,再将MyProject.ll的后缀名改为MyProject.l31
6. 修改MyProject。pkg,加入如下内容:
;Language - standard language definitions
&EN,ZH
;Standard SIS file header
#{"MyProject","MyProject"},(0x0FFAF737),1,0,0
;Supports Series 60 v 2.0
(0x101F7960), 0, 0, 0, {"Series60ProductID","Series60ProductID"}
;Files to be added here
"..\..\..\epoc32\release\thumb\urel\MyProject\MyProject.APP"-"!:\system\apps\MyProject\MyProject.app"
{"MyProject.r01"
"MyProject.r31"}-"!:\system\apps\MyProject\MyProject.r31"