Internationalization (i18n)
Duet supports Finnish, Swedish and English languages.
How to change language #
All Duet components are watching <html lang>
attribute and generally use the language that is set in that attribute. fi
, sv
or en
are allowed values in that attribute with Duet. If the lang
attribute is not found then Finnish is used as the default language.
When <html lang>
attribute is changed then also the components change their languages accordingly.
The automatic changes can be disabled by using a data attribute like this:
<html data-duet-lang-observe="false">
.
If the automatic changing is disabled then Duet components needs to be reinitialized in order to change the language they are using. The easiest way to do this is to reload the whole page with new language value set in <html lang>
attribute.
It is also possible to change languages in each component by using the language
properties of the components. However the language
properties are deprecated and will be removed in a future major release version.
Translations #
Components may have properties which can be used to change the default translations. If you change the defaults make sure that you provide correct translations for all languages.
Language properties in components #
There are a lot of language
properties in components and these are all deprecated and will be removed in a future major release version.