以编程方式使用i18n值的jquery
我有i18多语言文件,我可以在html元素中使用i18变量,这很好以编程方式使用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值
但在用户活动进行一些交互之后,我需要编辑此元素中的文本
对于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);