1

my goal is to create a multilanguage application. I started using the navigator.language but for IE it doesn't work because it recognize the system language and not the browser language as Chrome or Mozilla.

So I created a jsp page that print the language of the browser and with $http i'm able to collect.

The problem is that the language is taken only in the controller method but I need to find it before, in config method because from the language depends the routing of pages.

Please can you help me?

Giuseppe

  • Check this post: http://stackoverflow.com/questions/2678230/how-to-getting-browser-current-locale-preference-using-javascript – Maxim Goncharuk Mar 03 '17 at 12:32
  • it causes crash of application. it doesn't work. I'd like to have a solution using the $http inside config before the StateProvider routing. – Giuseppe De Luca Mar 03 '17 at 15:53
  • You can't use any services inside config, but you can create your own function which will send XMLHttpRequest to get data. More about it: https://www.w3schools.com/xml/xml_http.asp – Maxim Goncharuk Mar 03 '17 at 15:55

0 Answers0