Localization extension
When you create a widget that has translatable strings, add this default import to the widget's file:
import 'package:i18n_extension_core/default.i18n.dart';
This will allow you to add .i18n, .plural() and .gender() to your strings,
but won't translate anything.
- on
Properties
- i18n → String
-
Available on String, provided by the Localization extension
It returns the samekeyprovided, unaffected. This marks the string for future translation, and records the given key as a missing translation with unknown locale.no setter
Methods
-
fill(
List< Object> params) → String -
Available on String, provided by the Localization extension
Does ansprintfon thetextwith theparams. This is implemented with thesprintfpackage: https://pub.dev/packages/sprintf -
gender(
Gender gender) → String -
Available on String, provided by the Localization extension
It returns the same string, unaffected, for anygender. This marks the string for future translation, and records it as a missing translation with unknown locale. -
plural(
dynamic value, [Gender? gender]) → String -
Available on String, provided by the Localization extension
Translates a string where %d is replaced by the given number. It returns the samevalueprovided, where %d is replaced by the given number. This marks the string for future translation, and records the given value as a key missing translation with unknown locale. Thegenderis ignored.