Skip to content

[a11y][i18n] Option to specify an default language when creating a new dashboard #74

@fititnt

Description

@fititnt

Refs:


At this moment is not possible to explicitly specify an default language of and dashboard. On this issue my suggestion is

  1. To allow the user decide which language would want to set as default.
  2. Use this information to set any element that is a conteiner of the dashboard to that language

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.

// 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()

Captura de tela de 2020-04-16 15-44-30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions