使用此
pll\\u register\\u string()
关于函数。php
使用方法如下:
pll_register_string
Allows plugins to add their own strings in the “strings translation” panel. The function must be called on admin side (the functions.php file is OK for themes).
Usage:
pll_register_string($name, $string, $multiline);
‘$name’ => (required) name provided for sorting convenience (ex: ‘myplugin’)
‘$string’ => (required) the string to translate
‘$multiline’ => (optional) if set to true, the translation text field will be multiline, defaults to false
因此:
pll\\u register\\u字符串(\'标题标题\',\'要显示的标题\');
然后在dashboard config(仪表板配置)和languages(语言)上,您将找到一个名为“strings”的点击。在这里,您将有一个新创建的字符串和一个输入文本,用于填充站点上每种活动语言的翻译文本。编写翻译,然后使用以下函数:
pll\\u e()直接回显,或pll\\u()手动回显。你的孩子会像这样使用它:
pll_e(\'The title you want to appear\'); or
echo pll__(\'The title you want to appear\');
就是这样!:)