aissat / easy_localization

Easy and Fast internationalizing your Flutter Apps
https://pub.dev/packages/easy_localization
MIT License
925 stars 336 forks source link

Unable to load assets: assets/translations/cs.json #597

Open roma160498 opened 1 year ago

roma160498 commented 1 year ago

This is the error that some users get on their devices (and I can't reproduce it locally). I am using the same code as in example:

Screenshot 2023-06-25 at 2 19 20 PM

translation folder has just 2 files: en.json and ru.json. These are the only locales I support. Why is there an attempt to load some other file?

Screenshot 2023-06-25 at 2 21 10 PM
Lazizbek97 commented 1 year ago

the same problem, any news? or solutions?@roma160498

Fintasys commented 1 year ago

I'm using CodegenLoader and it works

      path: 'resources/langs',
      assetLoader: const CodegenLoader(),
Screen Shot 2023-07-06 at 0 15 22
Lazizbek97 commented 1 year ago

Actually i translated strings like this: "string".tr() So now, do i have to use generated class from codegenloader ? Changing all strings to class instances?

Fintasys commented 1 year ago

No you can still use "string".tr(). But you need to use build_runner now to generate strings

flutter pub run easy_localization:generate
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart
ariest-prophero commented 9 months ago

any updates on this?

should the fallbackLocale handle this right?

mathbalduino commented 2 days ago

Hey guys, still happening here. The lib is trying to load the language file for the default language of the device, even if it is not supported