StringTranslateExtension extension

Strings extension method for access to tr() and plural() Example :

'title'.tr()
'day'.plural(21)
on

Methods

plural(num value, {List<String>? args, BuildContext? context, Map<String, String>? namedArgs, String? name, NumberFormat? format}) String

Available on String, provided by the StringTranslateExtension extension

function translate with pluralization key Localization key value Number value for pluralization BuildContext The location in the tree where this widget builds args List of localized strings. Replaces {} left to right namedArgs Map of localized strings. Replaces the name keys {key_name} according to its name name Name of number value. Replaces {$name} to value format Formats a numeric value using a NumberFormat class
tr({List<String>? args, Map<String, String>? namedArgs, String? gender, BuildContext? context}) String

Available on String, provided by the StringTranslateExtension extension

Main function for translate your language keys key Localization key BuildContext The location in the tree where this widget builds args List of localized strings. Replaces {} left to right namedArgs Map of localized strings. Replaces the name keys {key_name} according to its name gender Gender switcher. Changes the localized string based on gender string
trExists({BuildContext? context}) bool

Available on String, provided by the StringTranslateExtension extension