Skip to content
flowon.com

Logic Composer

Localized resources

Store user-facing text once in every language your users speak, and show each user the text in their own language.

A localized resource is one piece of user-facing text, such as an error message, an email subject or a notification, with a translation for each language. Your logic refers to the resource by name, and at run time it gets the text in the language of the user it runs for. You keep translations out of your blocks and flows, and translators can update them without touching the logic.

One localized resource holds one text in several languages. For a family of messages, create one resource per message and give them a common name prefix, such as Quote_DiscountTooHigh and Quote_MissingPriceList.

  1. Go to Logic FabricSettingsLocalized Resources and select New.
  2. Enter a Name and choose the Project.
  3. In the Resource section, the Value editor shows one text box for each language available in your environment. Enter the text for each language your users use.
  4. Save the form.

The editor lists the languages that are enabled in the Dataverse environment, by name; you never enter language codes. If a language is enabled later, it appears with an empty box, and the existing translations are kept.

In the expression editor, open the Localized Value category and choose Localized Resource. Pick the resource by name and, optionally, a Language:

  • Without a language, the text is returned in the UI language of the current user.
  • With a language, the text is returned in that language, whatever the user’s own setting. Use this for text that goes to someone else, for example an email to a customer whose preferred language you know.

To include values such as an amount or a name, write numbered placeholders in every translation and fill them with the Format function:

Name English French
Quote_DiscountTooHigh Discount of {0}% exceeds your limit of {1}%. La remise de {0} % dépasse votre limite de {1} %.

Use Format with the Localized Resource Quote_DiscountTooHigh as the text to format, and DiscountPercent and MaxDiscount as the values. The result is the sentence in the user’s language with both numbers filled in. Every placeholder needs a value: a placeholder without a matching value makes the run fail. See text functions.

  • Flows: in the Error Message of the Raise Error step, in email subjects and bodies, in notes and tasks you create, and in any step setting that takes text.
  • Logic blocks: in formulas and in decision table and tree outcomes that return text.
  • Validations in recipes: when a validation in a recipe’s Validation stage fails, the user sees the block’s name, or the names of the failed rules for a validation set, not a localized resource. To use translated text, check the rule in a flow instead and put the localized text in the Error Message of its Raise Error step. See Logic recipes.
  • If a resource has no text for the requested language, the result is empty text. There is no fallback to another language, so fill in every language your users use.
  • A localized resource that a logic block, logic flow or logic recipe uses cannot be deleted (“Localized resource entry is in use. Remove all dependencies before deleting.”).
  • Translations can differ per environment. With the CLI’s data map files you can set them for each environment when you deploy; see Data mapping.
  • In a project whose solution is managed, the resource opens read-only.

A company in the Gulf serves customers in English and Arabic. Both languages are enabled in the environment.

  1. Create the resource Quote_DiscountTooHigh with the English text Discount of {0}% exceeds your limit of {1}%. and its Arabic translation, keeping both placeholders.
  2. Create Quote_ApprovedEmailSubject with Your quote {0} is approved and its Arabic translation.
  3. In the flow that checks quote discounts, add Raise Error with the error code DISCOUNT_LIMIT and an Error Message built with Format from Quote_DiscountTooHigh, DiscountPercent and MaxDiscount. The message is produced in the UI language of the user the flow runs for.
  4. In the approval flow, build the email subject with Localized Resource and its Language set to Arabic for customers who prefer Arabic, so they get an Arabic subject even when an English-speaking manager approves the quote.