ember-i18n使用双花括号翻译文本

时间:2016-12-19 05:08:44

标签: ember.js ember-i18n

如何翻译此Ember模板文本:

  

<p>The {{user.name}}'s tasks in "{{project.name}}"</p>

更新

问题解决了:

在模板中:

{{t "The (user.name)'s tasks in '(project.name)'" username=user.name projectname=project.name}}

翻译:

export default {
  "The (user.name)'s tasks in '(project.name)'":`Задачи {{username}} в "{{projectname}}"`
}

1 个答案:

答案 0 :(得分:0)

翻译文件:

export default {
  userTasks: `The {{username}}'s tasks in "{{projectname}}"`
}

模板:

<p>{{t "userTasks" username=user.name projectname=project.name}}</p>