flutter_i18n 0.5.0 copy "flutter_i18n: ^0.5.0" to clipboard
flutter_i18n: ^0.5.0 copied to clipboard

outdated

i18n made easy for Flutter. With flutter_i18n you can make your app international, using just a simple .json file!

[0.2.0] #

flutter_i18n now manage strings that contain parameters; an example can be: "Hello, {user}!" For a correct translation, you must use the third parameter of the translate method, a Map<String, String> where:

  • the keys are the placeholders used in the .json file (i.e. user)
  • the values are what you want to display

[0.3.0] #

flutter_i18n now supports language change at runtime. To use it, you must invoke the method

await FlutterI18n.refresh(buildContext, languageCode, {countryCode});

NOTE: countryCode is optional.

[0.4.0] #

flutter_i18n now supports plurals. To use it, invoke the method:

FlutterI18n.plural(buildContext, "your.key", pluralValue);

Where pluralValue is the integer value that will be used to determinate the plural form of the translation.

Here is an example of configuration of the .json file:

"clicked": {
    "times-0": "You clicked {times} times!",
    "times-1": "You clicked {time} time!",
    "times-2": "You clicked {times} times!"
  }

With this configuration, you must invoke the plural method as follow:

FlutterI18n.plural(buildContext, "clicked.times", pluralValue);

FlutterI18n will choose the right key using the value of pluralValue: it will match the last key with a value <= of pluralValue.

[0.5.0] #

flutter_i18n now supports the basePath configuration. The default one is: assets/flutter_i18n. To configure it, use the third optional parameter of FlutterI18nDelegate.

197
likes
0
pub points
97%
popularity

Publisher

unverified uploader

i18n made easy for Flutter. With flutter_i18n you can make your app international, using just a simple .json file!

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_localizations

More

Packages that depend on flutter_i18n