translatebebasan 0.0.1 copy "translatebebasan: ^0.0.1" to clipboard
translatebebasan: ^0.0.1 copied to clipboard

Make your application multi-language easily

translatebebasan #

License: MIT

translatebebasan is Use for make your application multi-language with easily implementation

Example #

And open this to see example here

Using #

Multiple Language in application #

Create a Map for each language that will be declared like this

Map<String, String> en_US = {
  'hallo_world': 'Hallo World',
  'text_home': 'You have pushed the button this many times:',
  'title': 'Flutter Demo',
};

Map<String, String> id_ID = {
  'hallo_world': 'Halo Dunia',
  'text_home': 'Anda telah menekan tombol ini sebanyak: ',
  'title': 'Flutter pratinjau',
};

And mapping map to class abstrac in glosarium and add supported language. In list supportedlocales first element is use as default locales

class LanguageService extends Glosarium {
  @override
  Map<String, Map<String, String>> get keys => {
        'id_ID': id_ID,
        'en_US': en_US,
      };

  @override
  List<Locale> get supportedLocales => const [
        Locale('id', 'ID'),
        Locale('en', 'US'),
      ];
}

In main added binding LocalesBasan().addGlosarium(LanguageService());

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await LocalesBasan().addGlosarium(LanguageService());
  runApp(MyApp());
}

And trala you just add in String .gr

Text(
    'text_home'.gr,
),

Issues #

Please file any issues, bugs or feature request here.

License #

This project is licensed under the MIT License

0
likes
90
pub points
24%
popularity

Publisher

unverified uploader

Make your application multi-language easily

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on translatebebasan