i18n_extension_core 2.0.6 copy "i18n_extension_core: ^2.0.6" to clipboard
i18n_extension_core: ^2.0.6 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);
}
1
likes
120
pub points
66%
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

#internationalization #localization #translation #server #backend

Documentation

API reference

License

unknown (LICENSE)

Dependencies

sprintf

More

Packages that depend on i18n_extension_core