简体   繁体   English

angular-translate-同一页面上的多种语言

[英]angular-translate - multiple languages on the same page

I'm building a questionnaire type app where you have the first person language on top and you have the exact same question on the bottom in a different language. 我正在构建一个调查表类型的应用程序,其中您使用第一人称语言排在第一位,而您使用另一种语言则排在底部。

right now i'm data binding all question to one big object like this. 现在,我正在将所有问题都绑定到这样的一个大对象上。 lanOneQuestion lanTwoQuestion and each question has like lanOneQuestion.one that corresponds to the each question. lanOneQuestion lanTwoQuestion和每个问题都与lanOneQuestion.one类似,它与每个问题相对应。 I get the string of data from a big json document. 我从一个大的json文档中获取数据字符串。

I'm wondering if I could use angular-translate, but I didn't see a way to use multiple language's at the same time? 我想知道是否可以使用angular-translate,但是我没有看到同时使用多种语言的方法吗?

You can use this code 您可以使用此代码

translatedWord = $translate.instant(YOUR_KEY,{},"",YOUR_LANGUAGE);

You can check this 你可以检查一下

https://github.com/angular-translate/angular-translate/pull/1328 https://github.com/angular-translate/angular-translate/pull/1328

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM