Expressions in Translatable Strings

VB Studio supports expressions, including ICU (International Components for Unicode) messages, in translatable strings that you save to a translation bundle.

Suppose you have a page that provides details for a training course and you want to add a message that displays the number of people enrolled. To do this, you would create an expression in the String Editor that outputs a different message depending on a numeric value, such as:

{COUNT, plural,
    =0 {No one is currently enrolled.}
    one {There is one person enrolled.}
    other {There are # people enrolled.}
}

For this to work, you'll need to assign a variable that holds the number of enrollees for the course to the COUNT parameter in your expression. In this example, if the value of the enrollees variable is "4", the output of the expression is "There are 4 people enrolled."

Just like static strings, strings with expressions can be reused in multiple places and translated along with static strings when you translate your App UI.

If you're unfamiliar with ICU, refer to the ICU User Guide..