Skip to content

unable to load assets:"asset/translation/en_us.json" #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ayaosama14 opened this issue Nov 11, 2024 · 1 comment
Open

unable to load assets:"asset/translation/en_us.json" #723

ayaosama14 opened this issue Nov 11, 2024 · 1 comment

Comments

@ayaosama14
Copy link

i get this :
Error while trying to load an asset: Flutter Web engine failed to fetch "assets/asset/translation/en-US.json".
HTTP request succeeded, but the server responded with HTTP status 404.

@asmiralic
Copy link

asmiralic commented Feb 26, 2025

@ayaosama14 I have same error. Did you found solution?

Edit:

I managed to found solution. In my case I didn't provide correct path for the [EasyLocalization] in my main file.

It was like this:

runApp(
ChangeNotifierProvider(
create: (context) => AppLanguageNotifier.instance,
builder: (context, child) => EasyLocalization(
supportedLocales: AppLanguageNotifier.instance.supportedLocales,
fallbackLocale: AppLanguageNotifier.instance.englishLocale,
path: "translations",
useOnlyLangCode: true,
useFallbackTranslations: true,
child: const MyApp(),
),
),
);

Now it looks like this:

EasyLocalization(
supportedLocales: AppLanguageNotifier.instance.supportedLocales,
fallbackLocale: AppLanguageNotifier.instance.englishLocale,
path: "translations",
useOnlyLangCode: true,
useFallbackTranslations: true,
child: const MyApp(),
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants