Ember.js 在embody.js中包含变量的串联字符串

Ember.js 在embody.js中包含变量的串联字符串,ember.js,handlebars.js,emblem.js,Ember.js,Handlebars.js,Emblem.js,我需要在embody.js中传输到i18n helper,将字符串常量与变量值连接起来,我如何才能做到这一点 each item in model.items div t "dict.{{item}}" 返回错误 Missing translation for key "dict.{{item}}" 如果您使用的是车把1.3+,则可以使用。首先,编写一个字符串连接辅助程序: Ember.Handlebars.helper('concat', function (a,

我需要在embody.js中传输到i18n helper,将字符串常量与变量值连接起来,我如何才能做到这一点

each item in model.items
    div
        t "dict.{{item}}"
返回错误

Missing translation for key "dict.{{item}}"

如果您使用的是车把1.3+,则可以使用。首先,编写一个字符串连接辅助程序:

Ember.Handlebars.helper('concat', function (a, b) {
    return a + b;
});
然后像这样使用它(对不起,我不知道会徽,所以我将使用正常的stache语法):

谢谢你在embody.js中的
t(concat文本“dict.”项)
{{t (concat 'dict.' item)}}