__()检索来自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:

__() 示例

注意

  • 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.

__() 源文件

相关