下载安装包
install package download
poedit
7z921.exe
mingw tools
libiconv-1.13.1-1-mingw32-dev.tar.lzma
gettext-0.17-1-mingw32-dev.tar.lzma
解压到wingw
写程序
Code: Select all
/*****hello.ec******/
#include <locale.h>
#include <libintl.h>
#include <gettext.h>
#define PACKAGE "hello"
#define LOCALEDIR "languages"
#define N_(msgid) gettext(msgid)
#define __printf__ printf
import "ecere"
class helloApp : Application
{
void Main()
{
setlocale(LC_CTYPE, "");
setlocale(LC_MESSAGES, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
printf(N_("this is a string\n"));
system("pause");
}
}
new
tab1
//////////
ecere0.44
tm
tm@ecere.com
Chinese
UTF-8
utf-8
nplurals=2; plural=(n!=1);
////////////
tab2
/////////
F:\work\temp
.
//////////
tab3
/////////
N_
/////////
save and open hello.po
修改
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=UTF-8\n"
msgsid "this is a string\n"
msgstr "这是一个字符串\n"
关闭poedit
将hello.mo放到程序目录下 languages/zh_CN/LC_MESSAGES/hello.mo