Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
以编程方式使用i18n值的jquery_Jquery_I18next - Fatal编程技术网

以编程方式使用i18n值的jquery

以编程方式使用i18n值的jquery,jquery,i18next,Jquery,I18next,我有i18多语言文件,我可以在html元素中使用i18变量,这很好 用于常量i18值 但在用户活动进行一些交互之后,我需要编辑此元素中的文本 对于expample: var checkDate = new Date(); $("#pcheckinfo").hide().empty().append("<i class='ace-icon fa fa-info'></i> There is new updates you can install. Date: " +

我有i18多语言文件,我可以在html元素中使用i18变量,这很好
用于常量i18值

但在用户活动进行一些交互之后,我需要编辑此元素中的文本

对于expample:

var checkDate = new Date();
    $("#pcheckinfo").hide().empty().append("<i class='ace-icon fa fa-info'></i> There is new updates you can install. Date: " + checkDate).show(500);
var checkDate=新日期();
$(“#pcheckinfo”).hide().empty().append(“您可以安装新的更新。日期:“+checkDate”).show(500);
有没有办法这样做:

$("#pcheckinfo").hide().empty().append("<i class='ace-icon fa fa-info'></i> 
[html]messages.randommessage" + checkDate).show(500);
$(“#pcheckinfo”).hide().empty().append(“
[html]messages.randommessage“+checkDate).show(500);

你有什么建议?(版本:i18next-1.11.1.js)

你可以试试这样的东西;添加一个带有要显示的值的标记
data-i18n=“key”
的范围

$("#pcheckinfo").hide().empty().append("<i class='ace-icon fa fa-info'></i><span data-i18n='messages.randommessage'></span>" + checkDate).show(500);
$(“#pcheckinfo”).hide().empty().append(“+checkDate”).show(500);