TextTranslateExtension extension
Text widget extension method for access to tr() and plural() Example :
Text('title').tr()
Text('day').plural(21)
- on
Methods
-
plural(
num value, {BuildContext? context, List< String> ? args, Map<String, String> ? namedArgs, String? name, NumberFormat? format}) → Text -
Available on Text, provided by the TextTranslateExtension extension
function translate with pluralization key Localization keyvalueNumber value for pluralization BuildContext The location in the tree where this widget buildsargsList of localized strings. Replaces {} left to rightnamedArgsMap of localized strings. Replaces the name keys {key_name} according to its namenameName of number value. Replaces {$name} to valueformatFormats a numeric value using a NumberFormat class -
tr(
{List< String> ? args, BuildContext? context, Map<String, String> ? namedArgs, String? gender}) → Text -
Available on Text, provided by the TextTranslateExtension extension
Main function for translate your language keys key Localization key BuildContext The location in the tree where this widget buildsargsList of localized strings. Replaces {} left to rightnamedArgsMap of localized strings. Replaces the name keys {key_name} according to its namegenderGender switcher. Changes the localized string based on gender string