i18n_extension_core 2.0.7 copy "i18n_extension_core: ^2.0.7" to clipboard
i18n_extension_core: ^2.0.7 copied to clipboard

Dart-only package for Translation and Internationalization (i18n), with Dart extensions. Easy to use for both large and small projects.

example/main.dart

import 'package:i18n_extension_core/i18n_extension_core.dart';

/// Go to the i18n_extension package (https://pub.dev/packages/i18n_extension) to read the docs
/// and see examples.
void main() {
  DefaultLocale.set("pt");

  String text = "Hello World".i18n;
  String filledText = "%s is %s years old".i18n.fill(["John", 30]);

  print(text);
  print(filledText);
}

extension Localization on String {
  //
  static final _t = Translations.byText("en_us") +
      {
        "en_us": "Hello World",
        "pt": "Olá Mundo",
      } +
      {
        "en_us": "%s is %s years old",
        "pt": "%s tem %s anos de idade",
      };

  String get i18n => localize(this, _t);

  String fill(List<Object> params) => localizeFill(this, params);
}
2
likes
140
pub points
49%
popularity

Publisher

verified publisherglasberg.dev

Dart-only package for Translation and Internationalization (i18n), with Dart extensions. Easy to use for both large and small projects.

Repository (GitHub)
View/report issues

Topics

#i18n #localization #translation #server #backend

Documentation

API reference

License

unknown (license)

Dependencies

sprintf

More

Packages that depend on i18n_extension_core