i18n_extension_core 3.0.0-dev.7 copy "i18n_extension_core: ^3.0.0-dev.7" to clipboard
i18n_extension_core: ^3.0.0-dev.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);
}
3
likes
0
points
17.2k
downloads

Publisher

verified publisherglasberg.dev

Weekly Downloads

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

License

unknown (license)

Dependencies

sprintf

More

Packages that depend on i18n_extension_core