复制代码 代码如下:
<?php
$domain = 'test';
bindtextdomain($domain, "locale/");//设置某个域的mo文件路径
textdomain($domain);//设置gettext()函数从哪个域去找mo文件
echo gettext("Hi!");//_()是gettext()函数的简写形式
?>
复制代码 代码如下:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION/n"
"Report-Msgid-Bugs-To: /n"
"POT-Creation-Date: 2009-01-19 17:47+0800/n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE/n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>/n"
"Language-Team: LANGUAGE <LL@li.org>/n"
"MIME-Version: 1.0/n"
"Content-Type: text/plain; charset=CHARSET/n"
"Content-Transfer-Encoding: 8bit/n"
#: hi.php:6
msgid "Hi!"
msgstr ""
新闻热点
疑难解答