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

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

pub package

i18n_extension_core #

This is the core Dart-only package for the i18n_extension package.

In your Flutter app: #

  • Do NOT include this core package directly.

    Instead, go to the i18n_extension package which already exports this core code, plus provides Flutter related code like the I18n widget that you must use to wrap your widget tree.

In your Dart server or Dart-only code: #

  • If you are creating code for a Dart server (backend) like Celest, or developing some Dart-only package that does not depend on Flutter, then you can use this package directly:

    import 'package:i18n_extension_core/i18n_extension_core.dart';
      
    extension Localization on String {
      static var t = Translations("en_us") + {"en_us":"Hello", "pt_br":"Hola"};
      String get i18n => localize(this, t);
    }
      
    DefaultLocale.set("es_ES");
    expect("Hello".i18n, "Hola");
    

Documentation #

Go to i18n_extension to read the docs.


Marcelo Glasberg #

https://github.com/marcglasberg
https://twitter.com/glasbergmarcelo
https://stackoverflow.com/users/3411681/marcg
https://medium.com/@marcglasberg

The Flutter packages I've authored:

My Medium Articles:

My article in the official Flutter documentation:

1
likes
0
pub points
65%
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

License

unknown (LICENSE)

Dependencies

sprintf

More

Packages that depend on i18n_extension_core