__('page','twentytwelve')
-
-
我冒昧地猜测您已经看过`array('name'=> __('page','twentytwelve'));`或`$name=__('page','twentytwelve');`.顺便说一句.I would venture to guess that you've either seen `array( 'name' => __('page','twentytwelve') );` or `$name = __('page','twentytwelve');`. Just as an aside.
- 3
- 2013-10-03
- Johannes Pille
-
1 个回答
- 投票数
-
- 2013-10-03
国际化和本地化(通常缩写为i18n 和分别为10n)是用于描述做出努力的术语 WordPress(及其他此类项目)可用除 英语,适用于来自不同地区,使用不同方言的人们 和本地偏好.
__()
在将消息作为参数传递给另一个函数时使用._e()
用于将消息直接写到页面上.有关此详细信息,请@ http://codex.wordpress.org/Translate_WordPressInternationalization and localization (commonly abbreviated as i18n and l10n respectively) are terms used to describe the effort to make WordPress (and other such projects) available in languages other than English, for people from different locales, who use different dialects and local preferences.
__()
is used when the message is passed as an argument to another function._e()
is used to write the message directly to the page. More detail on this @ http://codex.wordpress.org/Translating_WordPress-
+1,有关WP中gettext的详细信息,请参见[此答案](http://wordpress.stackexchange.com/questions/57735/whats-the-point-on-gettext-syntax/57748#57748)+1 and for a thorough breakdown on gettext in WP see [this answer](http://wordpress.stackexchange.com/questions/57735/whats-the-point-on-gettext-syntax/57748#57748)
- 3
- 2013-10-03
- Johannes Pille
我正在使用带有十二个主题的1.0版本.我看到了很多类似以下的代码,
如果我愿意,
它也工作正常.那为什么要使用
__()
?这有什么用?