Provides ability to translate Json files to localized texts in a variety of languages. Run time localization for Flutter|Dart applications.

How to use:

  1. import the package
import 'package:localaze/localaze.dart';
  1. Create a map of localized texts, or use json you fetched from the server.

final targetMap1 = <String, Map<String, String>>{
  'en': {
    'info_message': 'My name is {name} and I am {age} years old',
  'az': {
    'info_message': 'Mənim adım {name} və mən {age} yaşındayam',
  1. Set configuration and initialize the Localaze instance.
Translator.config = Translator.config.copyWith(
    translations: targetMap1,
    supportedLanguages: {'en', 'az'},
    translationsStructure: TranslationsStructureEnum.languageCodeFirst,
  1. Set params for dynamic translations.
ParamModel name(String value) => ParamModel(key: 'name', value: value);

ParamModel age(int value) => ParamModel(key: 'age', value: "$value");
  1. Use the tr extension method to get the localized text.
print(Translator.translate('welcome_message', 'az', name('John'), age(23)));