I'm trying to use jquery-localize for localization of my small app. My wish is to use Danish language if the user is Danish, and English otherwise.
I tried doing nothing, but if an unknown language uses the app, then all strings are empty.
My current solution is this
chosenLanguage = window.navigator.userLanguage || window.navigator.language;
langSearch = new RegExp('^da', 'i');
if (chosenLanguage.match(langSearch)){
// Do nothing
}
else {
$("[data-localize]").localize("local", { language: "en" });
}
But this solution seems too complex to be correct. Any help or suggestions is appreciated!