0
I’m using the language internationalization feature (i18n) in a Grails project. A portion of the tags are inserted directly into the files. gsp and another part is in the JS scripts (Jquery/Bootstrap). These that are in the scripts need to use a third-party jquery lib. The Grails feature checks the system language. Therefore, if the system and browser are configured with different languages, the site will display one part of the text in one language and the other part in the other language. To try to get around this problem, I tried reading the system language using jQuery, then compare with the browser language and match both, but apparently the command to check the system language does not work (tested on mac, win, android, in FF, Chrome, Safari)
var userLang = navigator.language || navigator.userLanguage;
var systemLang = navigator.systemLanguage;
console.log( userLang + " : " + systemLang );
So I need help to make languages equal, either by Jquery or Grails. Someone would know how to do this?
In my opinion, do not use jquery to check what kind of language the browser is using... check the graisl documentation:
http://guides.grails.org/grails_i18n/guide/index.html
– fsi