karee.internationalization library Null safety

Karee internationalization.

Karee provides this library as a simplest way to work with internationalization, this lib gives you translation support trough the string extension defined and named StringTranslator by adding two methods StringTranslator.translate and StringTranslator.translateWithParams.

To define you translation dictionary, get open file in {@PROJECT_DIR@/resources/i18n/locale.json}.

Karee Internationalization also provides a simplest way to change lang in your application, you need to call KareeInternationalization.changeLanguage with Locale that matches with you dictionary files.

eg:


void updateUserLanguage(Locale locale){

  // Applying change for future connexion

  userService.changePreferedLanguage(locale);

  //
  // Applying change for in all the application.
  // Precondition is that newLang is supportedLocal in your KareeMaterialApp

  KareeInternationalization.changeLanguage(newLang);

}

Classes

AppLanguage
AppLanguage: define the model of current language for internationalization
AppLocalization
AppLocalization
KareeInternationalization

Extensions

AppLocalizationExtension
StringTranslator
Extension that applies text translation in karee.