angularjs翻译与参数,也被翻译

时间:2018-05-23 12:15:37

标签: angularjs translation

我该如何翻译表达式:

     <div translation = "download" translate-values = "{{'msg': 'file.pdf'}}">
     </ Div>
     <div translation = "download" translate-values = "{{'msg': 'file.pic'}}">
     </ Div>

在文件en.json

...{
download : "Download {{ msg | translation}}"
   file: {
     pdf: "pdf file"
         pic: "pictures"
     }
   }

我希望得到结果,例如: 英语 “下载pdf文件”和“下载图片” 并在波兰语 “Sciagnij pik pdf”和“Sciagnij obrazki”

1 个答案:

答案 0 :(得分:0)

好吧我已经知道了......我犯了一个错误:

 <div translation = "download" translate-values = "{{'msg': 'file.pdf'}}"></div>

应:

 <div translation = "download" translate-values = "{'msg': 'file.pdf'}"></div>