You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the idea behind the hxldash is be quick and smart, there is something that is possible to implement by default: guess the languages that the user browser is using, and prefer use these languages. Still a good idea allow user specify other, but can be used as default.
This may not be perfect (for example, an user who works with English a lot may actually change languages all the time) but for non-English speakers the fact that they go to the dashboard and somewhat it even suggest their language.
JS to use for debugging
here a quick vanila JS to do testing on this. Some languages have lots of characters, so if want just use the main 2 letters, this one helps do this.
// used on https://github.com/fititnt/ais-ethics-tags/blob/master/assets/js/ais-ethics-tags.js#L455
// public domain, dont need to cite
function whoAmI () {
let me = {};
me.myLanguage = navigator.language || navigator.userLanguage;
me.myLanguagesOriginal = navigator.languages || [me.myLanguage];
me.myLanguages = [];
me.myLanguagesOriginal.forEach(function(lang) {
let wdLang = lang.split('-');
if (me.myLanguages.indexOf(wdLang[0]) === -1) {
me.myLanguages.push(wdLang[0]);
}
})
return me;
}
whoAmI()
The text was updated successfully, but these errors were encountered:
Refs:
<html>
to<html lang="en">
) #73At this moment is not possible to explicitly specify an default language of and dashboard. On this issue my suggestion is
Smart suggestions
Since the idea behind the hxldash is be quick and smart, there is something that is possible to implement by default: guess the languages that the user browser is using, and prefer use these languages. Still a good idea allow user specify other, but can be used as default.
This may not be perfect (for example, an user who works with English a lot may actually change languages all the time) but for non-English speakers the fact that they go to the dashboard and somewhat it even suggest their language.
JS to use for debugging
here a quick vanila JS to do testing on this. Some languages have lots of characters, so if want just use the main 2 letters, this one helps do this.
The text was updated successfully, but these errors were encountered: