easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

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

Open roma160498 opened this issue 1 year ago • 5 comments

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

roma160498 avatar Jun 25 '23 10:06 roma160498

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

Lazizbek97 avatar Jul 05 '23 14:07 Lazizbek97

I'm using CodegenLoader and it works

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

Fintasys avatar Jul 05 '23 15:07 Fintasys

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?

Lazizbek97 avatar Jul 05 '23 15:07 Lazizbek97

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

Fintasys avatar Jul 05 '23 16:07 Fintasys

any updates on this?

should the fallbackLocale handle this right?

ariest-prophero avatar Feb 22 '24 23:02 ariest-prophero