I'm using the Language Internationalization (i18n) feature in a Grails project. Some of the tags are inserted directly into the .gsp files and another part is in the JS (Jquery / Bootstrap) scripts. These in the scripts need to use a third-party jquery lib. The Grails feature checks the system language. Therefore, if the system and the browser are configured with different languages, the site will display a portion of the texts in one language and the other part in the other language. To try to work around this problem, I tried to read 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 in 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 the same, either by Jquery or by Grails. Would anyone know how to do this?