flutter_i18next 0.1.0 copy "flutter_i18next: ^0.1.0" to clipboard
flutter_i18next: ^0.1.0 copied to clipboard

outdated

i18next for Flutter.

flutter_i18next #

A package to bring i18next support for Flutter! This is heavily based on flutter_i18n but with lots of modification and simplifications.


Usage #

First, Add flutter_i18next to your pubspec.yaml:

dependencies:
  flutter_i18next: ^0.1.0

Next, Add an instance of I18NextDelegate to your app's localizationsDelegates:

MaterialApp(
  supportedLocales: [
    Locale('en'),
    Locale('fa'),
  ],
  localizationsDelegates: [
    I18NextDelegate(
      translationLoader: FileTranslationLoader(
        useCountryCode: false,
        basePath: 'assets/i18n',
      ),
    ),
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate
  ],
)

Now you can get the translation using the extension method on BuildContext or the I18Next class directly:

I18Next.t(context, 'label.main')
//or
context.t('label.main')

:WIP:

3
likes
0
pub points
16%
popularity

Publisher

unverified uploader

i18next for Flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, path, xml2json, yaml

More

Packages that depend on flutter_i18next