Set up the translations module
Overview
You can send for translation all ASP.NET Core widgets, both built-in and dynamic, using the Translations module.
By default, Sitefinity CMS has a registration only for the Content block widget.
You must explicitly register all other widgets in the translation module settings.
Register a widget for translation
To create a new registration, perform the following:
- In Sitefinity CMS backend, navigate to Administration » Settings » Advanced.
- In the left navigation, click Translations » Strategies.
- Create a new entry of type
DecoupledControlStrategy.
Or enter the full name of the strategy manually: Telerik.Sitefinity.Translations.Strategies.DecoupledControlStrategy
- Enter the name of the widget.
NOTE: For a list of built-in widget names, see Sitefinity GitHub repository » ViewComponents.
- In PropertyMappings, list all of the properties that you want to translate.
For more information, see Translations module settings.
NOTE: Nested properties are separated by a period (.) in the path.
For example, MyCompositeProp.MyTextField
Default value sent for translation
When you create a new translation strategy, you can define a default value field. The field provides a fallback value that will be used during translation, if the original value is not stored in the database.
EXAMPLE: When creating a form with a submit button labeled Submit, the label is not persisted. In such cases, if the action is set to Translate, the system will use the value from the Default value field.
NOTE: You can use the default value field only for translation strategies of type Telerik.Sitefinity.Translations.Strategies.DecoupledControlStrategy.
To modify the default value sent for translation of the form's submit button, perform the following:
- In Sitefinity backend, navigate to Administration » Settings » Advanced.
- In the tree on the left, click Translations » Strategies » SitefinitySubmitButton » Property mappings and click Label.
- In the Default value field, enter the value that will be sent for translation.
For example, enter Submit
The default value will be sent for translation unless the field has been modified.
NOTE: This only applies when the action is set to Translate.