Assistance with Fallback to Local JSON Files #1276
Unanswered
ahmedghonim
asked this question in
Q&A
Replies: 1 comment
-
What is the specific issue you have? The code above looks like a good starting point, but instead of calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
Hi next-intl Team,
I'm currently working on a project using next-intl for internationalization, and I've run into an issue with setting up a fallback mechanism. Here's what I'm trying to achieve:
1- Primary Goal: Fetch translations from an API based on the user's locale.
2- Fallback Mechanism: If the API doesn't provide translations for a specific locale, I want to fall back to local JSON files stored in the /public/locales directory.
this is my code
and this is my local file
(await import(
./public/locales/${locale}.json)).default
Beta Was this translation helpful? Give feedback.
All reactions