[FIXED] Easy Localization: Localization key […] not found

Issue

I am using easy_localization: ^2.3.3 in a flutter project with CSV loader. When I build it is not able to find keys and it gives "Easy Localization: Localization key […] not found". Any ideas why is this happening?


runApp(EasyLocalization(
    supportedLocales: [
      Locale('en', ''),
      Locale('it', ''),
      Locale('es', ''),
      Locale('de', ''),
      Locale('fr', ''),
      Locale('pt', ''),
    ],
    path: 'resources/langs/langs.csv',
    fallbackLocale: Locale('en', ''),
    saveLocale: false,
    useOnlyLangCode: true,
    assetLoader: CsvAssetLoader(),
    child: MyApp(status),
  ));
}

Solution

I found a solution looking at this bug: https://github.com/aissat/easy_localization/issues/190#

I added the following:

dependencies:
  easy_localization_loader:
    git:
      url: git://github.com/aissat/easy_localization_loader.git
      ref: overman-dev

then I did a

flutter pub upgrade

and also changed the code into this

runApp(EasyLocalization(
    supportedLocales: [
      Locale('en'),
      Locale('it'),
      Locale('es'),
      Locale('de'),
      Locale('fr'),
      Locale('pt'),
    ],
    path: 'resources/langs/langs.csv',
    fallbackLocale: Locale('en'),
    saveLocale: false,
    useOnlyLangCode: true,
    assetLoader: CsvAssetLoader(),
    child: MyApp(status),
  ));

It worked.

Answered By – avafab

Answer Checked By – Pedro (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published