The translation rules feature is available for all Lokalise Messages integrations from the Lite plan and above. Language-specific translation rules, however, are available only on the Pro plan.
Translation rules enable you to override the default machine translation choice algorithm globally or on a per language basis. Please note that this feature does not affect language detection.
Getting started
To get started with this feature, open your dashboard and switch to the Translation rules tab:
You'll be presented with the following screen (the UI might slightly vary but the available options will be the same):
General translation rules
Under the General translation rules section you can adjust global translation settings:
Translation provider β this is the default provider that will be used for all translations unless specific translation rules apply.
Fallback provider β if for some reason Lokalise Messages were unable to perform translation using the default provider (because the language pair is not supported or an error happened), the fallback will be used instead. We recommend choosing Google Translate as the fallback as it has the best language coverage.
If the Fallback provider has been specified but the default provider hasn't been chosen, Lokalise Messages will use the fallback provider in all cases (unless specific rules apply).
Click Clear settings to revert to default translation rules.
Specific translation rules
This feature is available only on the Pro plan.
For a more fine-grained control, proceed to the Specific translation rules section. Here you can choose translation providers on a per language pair basis. These rules have higher priority than the global settings covered above.
To get started, click the New rule button:
Choose the languages from the dropdown and then pick one of the providers:
Please be aware that these rules are bidirectional, meaning if a rule is set to translate an incoming message from one language to another, the same rule will apply when translating in the reverse direction.
Should the selected provider be incompatible with the specified language pair, we will automatically switch to the default provider and, if necessary, to the fallback provider. In instances where an error occurs with the chosen provider for a particular language pair, Lokalise Messages will default to the fallback provider.
In the event you select a language pair provider without specifying default and fallback options, Google will be established as the default provider for both rules.
Managing rules
After a rule has been created, you can find it in the list under the Specific translation rules section:
Click on the "trash bin" icon to delete a rule.
If you would like to update the rule (for example, adjust the formality level for the DeepL provider), you should add a new rule with the same language pair. After this rule is created, it'll overwrite the previously created rule with the same languages.
Note on glossaries
If you would like to use glossary with translation rules, make sure to choose Google Advanced provider. For example, if the Google advanced provider has been chosen for a specific language pair, and there are glossary entries available for this pair, they'll be utilized when performing translations.