WordPress函数文档add_user_meta()

检索来自translate()的被翻译过的字符串 描述 译文 检索来自translate()的被翻译过的字符串…

检索来自translate()的被翻译过的字符串

描述

译文

检索来自translate()的被翻译过的字符串

原文

Retrieves the translated string from the translate().

用法

<?php $translated_text __$text$domain ); ?>

参数

$text

(string) (必填) Text to translate

默认值: None

$domain

(string) (可选) Domain to retrieve the translated text

默认值: ‘default’

返回值

(string) 

Translated text

示例

Make a string inside your plugin or theme translatable:

‘mytextdomain’ needs to be a unique text domain used throughout your plugin/theme. This should always be directly passed as a string literal as shown above, not a string assigned to a variable or constant. E.g., this is incorrect:

This seems to work, but it will interfere in automatic parsing of your plugin/theme’s files for translation. See these for more information:

  • Internationalization: You’re probably doing it wrong – Otto on WordPress
  • Translating WordPress Plugins and Themes – Mark Jaquith

注意

  • See __() An alias of translate()
  • l10n is an abbreviation for localization.
  • The function name is two underscores in a row. In some fonts it looks like one long underscore. (Who says programmers don’t have a sense of humor.)

历史

  • 添加于 版本: 2.1.0

源文件

__() 函数的代码位于 wp-includes/l10n.php.

相关

L10n:
translate(),
__(),
_e(),
_n(),
_x(),
_ex(),
_nx(),
esc_attr__(),
esc_attr_e(),
esc_attr_x(),
esc_html__(),
esc_html_e(),
esc_html_x(),
_n_noop(),
_nx_noop(),
translate_nooped_plural()

  • 原文:http://codex.wordpress.org/Function_Reference/__
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT