WordPress 语言翻译

2012-08-28   来源:站长日记       编辑:沧海桑田   类别:开源博客系统    转载到:    发表评论

国际化的软件 都有自己的语言处理系统 WordPress的语言处理是用函数的方式__()和_e()

WordPress languages translation
What do the _() and _e() functions in WordPress do?

In WordPress, strings in the php files are marked for translation to other languages,
 localization using two ”tags” which are actually functions. They are:

__()
_e()

These accept a string as an argument. For example:

__(”Translate Me”)
_e(”Translate Me”)

The only functional difference between the two methods is that _e() echoes the string and () simply returns the string.
() is used when you want to supply a string to a function.
_e() is used when you want to output the string as part of your XHTML.

We have a tool which goes through all of the php files, extracting strings that are marked by __() and _e().

110

0
110|0 | 鲜花 VS 砸蛋 | 372阅读 0评论 wordpress
 
不想登录?直接点击发布即可作为游客留言。
昵称  邮箱 网站 验证码 = 1+1