"Project-Id-Version: 0.1 "PHPChina 开源社区门户5z] M"D IG
"POT-Creation-Date: 2003-04-21 22:31+0800 "PHPChina 开源社区门户pfnu }Fu
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE "
;I:\B[oOG,y d24669 "Last-Translator: Ptker <ptker@hotmail.com> "
;|YC$cd|24669 "Language-Team: zh_TW <ptker@hotmail.com> "PHPChina 开源社区门户MW2Q7p\
"MIME-Version: 1.0 "
QE:Z"]| L24669 "Content-Type: text/plain; charset=BIG5 "
6lT@'K%]3|8?24669 "Content-Transfer-Encoding: 8bit "PHPChina 开源社区门户^ F']vth
{3?~0rT)R24669 #: hello.php:14
5Sh"p9lg|g24669 msgid "Hello World!"PHPChina 开源社区门户~Qij0Tr
msgstr "世界,您好!"PHPChina 开源社区门户 |0RO9s0G+pxr&B;X
q.Dy5R;l24669 3、创建MO档
Fy+i,F&}24669 msgfmt -o hello.mo hello.poPHPChina 开源社区门户T(qj3j.M J^
运行后将产生一个hello.mo二进制档。PHPChina 开源社区门户9sR2g/j{ o9r
PHPChina 开源社区门户 MfAU*H'itj D
4、最后将 hello.po、hello.mo 拷贝到相关语系的目录下即可。PHPChina 开源社区门户+WP){lt YMVqf%u
PHPChina 开源社区门户8T-b8Z"},K
五、在IE中输入: http://localhost/hello.php (http://php.phpx.com/http://localhost/hello.php) ,现在的结果就是:“世界,您好!”
gu0@1~ @L,r&P24669
A u[fnb1T24669 本文链接:
F)z]|}%l24669 http://www.openphp.cn/index.php/article/2/45/index.html (http://php.phpx.com/http://www.o ... cle/2/45/index.html)
s6n"hU/QyJrQ;f24669 PHPChina 开源社区门户} ?s(q4SW%K?
e j?x_ bQ24669 因为我进行的是嵌入式系统中实现gettext的功能,因此,实现起来与文章中的内容有所不一样,具体我们可以根据LFS中的有关gettext的安装手册来做
#hk2cR%C24669 PHPChina 开源社区门户X|+fi/B*|3h
Gettext 用于系统的国际化(I18N)和本地化(L10N),可以在编译程序的时候使用本国语言支持(Native Language Support(NLS)),其可以使程序的输出使用用户设置的语言而不是英文.PHPChina 开源社区门户Eu3c^._PVB p
PHPChina 开源社区门户5@+u*QR k
安装下列程序: autopoint, config.charset, config.rpath, envsubst, gettext, gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, ngettext, project-id, team-address, trigger, urlget, user-email and xgettextPHPChina 开源社区门户*vnY+S$d"d C
*pf#zM z ]qj24669 安装下列库文件: libasprintf[a,so], libgettextlib[a,so] 和 libgettextsrc[a,so]
d[f I R-u6]4bw24669 PHPChina 开源社区门户)L.@HyH2Z(J
Gettext 安装依赖关系PHPChina 开源社区门户 n yc"J@*p,d
Gettext 依赖于: Bash, Binutils, Bison, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, Make, Sed.PHPChina 开源社区门户.@4kqo@8D
PHPChina 开源社区门户x4hm(P{Y
让我们再回到系统中,我们会发现,并不是简单的把bin,lib的文件拷贝过去就可以了,最重要手是把原系统中的/usr/lib/locale(仅适用于redhat)文件打包,用locale -a|grep zh_CN进行检验后才算完事。
l.pRbD)M x(S'IP1q5M24669 另:如果使用的是gettext-2.13版本之前,在使用xgettext *.php可能会出现PHPChina 开源社区门户+~3N&m I F di*AI
xgettext extension `php' is unknown 等出错信息!
3|0F!e~V24669 解决方法是升级你的gettext软件包到2.14
«
»