Adapt_framework: languagePicker: 'change language' popup needs a lang attribute

Created on 28 May 2020  路  11Comments  路  Source: adaptlearning/adapt_framework

Because the text of the popup is in the language the learner is trying to switch to, it is therefore different to the language declared via the lang attribute of the html element.

It should be possible to add lang attribute to Notify that specifies the language used in the popup correctly. This would be beneficial both for assistive technology and for language-specific styling as well (for example, you may want to use a different font for non-Latin languages)

Most helpful comment

A few things to note about the above code:

  • Object.assign() can be used since we now have a polyfill for IE
  • No || {} fallback is needed because Object.assign() handles falsies
  • lang doesn't need quotes

All 11 comments

Ideally alongside the lang attribute there should be a language class is-en / is-de to amend styling / font is required.

Ideally alongside the lang attribute there should be a language class is-en / is-de to amend styling / font is required.

small suggestion: something more like is-lang-de might be a bit clearer? otherwise someone might look at a class like is-de and wonder what on earth it means! Not to mention is-it for Italian...

I think class will be a fine. Is there attribute really need? PR

As @moloko says, the attribute is useful for assistive technology.

@NayanKhedkar Jaws uses the lang attribute to work out what language to use when reading out the text

Hi, Should I write here

attributes: function () {
      return _.extend({
        'role': 'dialog',
        'aria-labelledby': 'notify-heading',
        'aria-modal': 'true'
      }, this.model.get('_attributes') || {})
 }

and here
_attributes: { 'lang': newLanguage }

A few things to note about the above code:

  • Object.assign() can be used since we now have a polyfill for IE
  • No || {} fallback is needed because Object.assign() handles falsies
  • lang doesn't need quotes

Dependent PR:

not actually fixed yet..!

I think this issue can be closed now?

yep, done in FW v5.6 and languagePicker v4.1.0

Was this page helpful?
0 / 5 - 0 ratings