Getting data from backend API. #459
Unanswered
wajidafridi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Considering the example https://github.com/amannn/next-intl/tree/main/examples/example-next-13
below code is from layout.tsx file.
async function getMessages123(locale: string) { try { return (await import(
../../../messages/${locale}.json)).default; } catch (error) { notFound(); } }
Here in this example, we get translation from local json file.
What I Want:
I want that I get data from backend API first, if it fail than it used local translation data from json file as it doing now.
Beta Was this translation helpful? Give feedback.
All reactions