Apply the dictionary over a string, parsing the expressions in the string and replacing them with the values found for the respective keys inside the dictionary for a language.
Always returns a string. Return the translated string if there are dictionary expressions,
the raw string with no changes if there are no expressions, and an empty string if rawString
is undefined.
String with words and/or expressions
Optional
_options: IApplyToStringOptionsObject containing options for the dictionary
Translated string with all expressions replaced
Get all (and only) the expressions in a string and their parameters if applicable, ignoring normal words and phrases.
String with words and/or expressions
Array of parsed expressions found in the string
Get the language data for a dictionary.
ID or Slug of the dictionary
Language code (defaults to instance language)
Language data or null if not found
Get value from a key in a specific dictionary for a language.
Name of the language (locale code)
Name of the dictionary
Name of the key
The translated value or the expression if not found
Parse an expression and extract the names of the dictionary, the key, and any arguments that are passed in the expression.
Returns null
if the value passed is not parseable
String expression
Parsed expression or null if invalid
Resolve an expression in a language, replacing the parameters in the dictionary value with the arguments passed in the expression.
Object with the language and the parsed expression
Resolved string with parameters replaced
Multi-language support for TagoIO applications
This class provides internationalization (i18n) functionality for TagoIO applications, allowing you to manage translations and apply language-specific content dynamically. Supports expression parsing, language switching, and translation management.
Example: Basic dictionary usage
Example: Expression parsing