Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

XPEHO/blabla

Repository files navigation

blabla

Simple Flutter translation management implementation plugin.

Getting Started

Prerequisites

  • Add the assets dependecies in your pubspec.yaml, these assets should be in the language folder

ex :

flutter:
    assets:
        - language/

Implementation

  • In the main of your application, set the supportedLocales and the localizationsDelegates of your MaterialApp

supportedLocales: appLocales, localizationsDelegates: blablaDelegates,

Usage

  • In the asset json, add a translation key/value

ex :

"example": "This is an example of translation"
  • In any text, use the translation using the key

ex :

translate("example")
  • By default, there will only be english in appLocales, but you can override appLocales before the app run in order to add any locales you want
  • The locale used if the device locale isn't in appLocales or if the key doesn't exist in the asset file will be the first locale in appLocales

ex :

appLocales = [
    Locale('en', 'US'),
    Locale('fr', 'FR'),
];
runApp(MyApp());

About

Simple Flutter translation management implementation plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published