reflex
reflex
NNuxt
Created by reflex on 6/6/2024 in #❓・help
i18n dynamically load locale files
I am trying to load lazy json file with translations
export default async (context) => {
return await new Promise((resolve, reject) => {
context.$axios
.get('/static/lang/cs-CZ.json')
.then((response) => {
resolve(response.data)
})
.catch((error) => {
reject(error)
})
})
}
export default async (context) => {
return await new Promise((resolve, reject) => {
context.$axios
.get('/static/lang/cs-CZ.json')
.then((response) => {
resolve(response.data)
})
.catch((error) => {
reject(error)
})
})
}
But it make SSR return translation keys and then call ajax call which load messages from json Any idea?
1 replies