使用 angular-translate 获取当前语言 [英] Get current language with angular-translate
本文介绍了使用 angular-translate 获取当前语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在控制器中获取当前使用的语言(没有 $translateProvider
)?
Is there a way to get the current used language in a controller (without $translateProvider
)?
在 $translate
服务中找不到任何内容.
Couldn't find anything in the $translate
service.
推荐答案
$translate.use()
是一个 getter 和 setter.
$translate.use()
is a getter and setter.
查看文档链接中的演示:
See this demo found in links of docs:
http://jsfiddle.net/PascalPrecht/eUGWJ/7/
这篇关于使用 angular-translate 获取当前语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文