t function
Translates messageId for the current active locale, automatically tracking reactivity.
When called inside a Live builder without an explicit locale, reads
BloomI18n.instance.locale so that updates to the current locale trigger a fine-grained
re-render of the component.
BloomNode greeting() => Live(() => Div(
text: t('greeting', args: {'name': 'Alice'}),
));
See also:
- BloomI18n.translate, the full translation method on the store instance.
- tr, shorthand with positional arguments.
- setLocale, changes the active locale globally.
Implementation
String t(
String messageId, {
Map<String, Object>? args,
String? locale,
}) =>
BloomI18n.instance.t(messageId, args: args, locale: locale);