JaRavi
JaRavi

Reputation: 71

how can we retrieve language set in the browser using angularJS? Is there a way?

I can make use of $translate.use() in case of setting the preferred language in my code. What if I change the language from english to french in my browser, How can I access the language key from my angularJS code?

Upvotes: 0

Views: 250

Answers (1)

uniquerockrz
uniquerockrz

Reputation: 231

You can use navigator.language to get the language set in the browser

navigator.language

To get a list of languages supported by the user:

navigator.languages

Upvotes: 1

Related Questions