Multi Language
Overview
All our configurations as well as the user interface support multiple languages. We retrieve the language from the SharePoint user interface. At the time of writing we support
- English
- German
- French
- Dutch
In the configuration all options that are visible to the end user are of type ConfiguredMuiString. You can find more details in the Reference Documentation.
Configuration Examples
Plain String
Will be used as is, i.e. the same value will be rendered for all languages.
{
"title": "My title for all languages"
}
IMuiString
Easy approach to configure all relevant languages directly in the config.
{
"title": {
"en": {
"My English title"
},
"de": {
"My German title"
},
/* ... */
}
}
ExpressionString
Use an ExpressionString that is evaluated at runtime. For a list of all our pre-configured string resources to use with the translate
util please view ITranslationsProvider
{
"title": {
"expression": "_mp.util.translate('content')"
}
}
In case you want to make your expression MUI string capable, you can use the IEnhancedExpression to configure additional variables (in IMuiString-format) that can then be translated in the expression using the _mp.util.translate
-method:
{
"expression": {
"value": "'<div> ' + variables.name + ', ' + _mp.util.translate(variables.text) + '?</div>'",
"variables": {
"name": "fred",
"text": {
"de": "wie geht es dir",
"en": "how are you"
}
}
}
}