LocalizationManager constructor

LocalizationManager({
  1. required List<SupportedLocale> supportedLocales,
  2. required Locale initialLocale,
  3. required List<String> initialTranslations,
  4. required bool debugMode,
  5. bool saveLocale = true,
})

Creates a localization manager with the necessary initial setup.

supportedLocales is a list of locales that the application supports. initialLocale is the locale to be set initially. initialTranslations is a list of initial translation keys to load. debugMode enables or disables debug logging. saveLocale determines whether to save the locale to persistent storage.

Implementation

LocalizationManager({
  required this.supportedLocales,
  required Locale initialLocale,
  required List<String> initialTranslations,
  required this.debugMode,
  this.saveLocale = true,
})  : currentLocale = initialLocale,
      logger = Logger(debugMode: debugMode) {
  translator = TranslatorPro();
  loader = LoaderPro(logger);
  _init(initialTranslations, initialLocale);
}