All Collections
Lokalise Messages
General information
Lokalise Messages: Exclusion rules
Lokalise Messages: Exclusion rules

Choose when and how the incoming messages should be translated and when they should be left intact.

Ilya Krukowski avatar
Written byIlya Krukowski
Updated over a week ago

Exclusion rules feature is available for all Lokalise Messages integrations from the Start plan and above.

Getting started

Exclusion rulesenable you to choose which messages (or messages parts) should not be translated. Please note that this feature works only for theincoming messagessent by your customers.

To get started, proceed to your Lokalise Messages dashboard and clickExclusion rules:

You'll be presented with the following screen (the UI might slightly vary but the available options will be the same):

Creating exclusion rules

First of all, you'll have to choose one of the translation conditions from theApply conditiondropdown:

  • Translate only before——如果speci传入消息包含一个字符串fied in the current rule, only the textbeforethe specified string will be translated. The rest of the message will be left intact.

  • Translate only after——如果speci传入消息包含一个字符串fied in the current rule, only the textafterthe specified string will be translated. The rest of the message will be left intact.

  • Translate only when not equals— if the incoming message equals the text specified in the rule then the whole message will be ignored. No detection or translation will be triggered.

Next, fill in theWhen message containsfield and specify text to use in the chosen condition. If needed, tick the case-insensitive field to make the entered text case-insensitive.

Once you're ready, click theAdd rulebutton.

Then you'll be able to create additional rules. If you've created multiple rules, these will be applied in the order they appear in the UI.

Previewing and special notes

After the rule is created, you can preview it by entering a message in thePreviewfield and clicking thePreviewbutton:

Note that theTranslation resultsfield does not contain the word "Lokalise" because we've chosen to exclude it.

Please be aware that if after applying all the exclusion rules the translation results become empty, the incoming message will be effectively ignored: Lokalise Messages will not try to perform language detection or translate it:

Did this answer your question?