dev is still used as a fallbackLng (missing string for a locale) even when setting fallbackLng: 'en'
8.0.0-beta.4
Setting fallbackLng: 'en' in next-i18next.config.js.
Should use en as fallback language when a string is missing for a locale.
I cannot reproduce. If I checkout the next-v10 branch, and add next-i18next.config.js:
module.exports = {
fallbackLng: 'en'
}
It works as expected. Please provide repro steps. Thanks!
I am having the same problem. In serverSideTranslations, only the store for initialLocale is populated and not for the fallback language.
namespacesRequired.forEach((ns) => {
initialI18nStore[initialLocale][ns] = (
(i18n.services.resourceStore.data[initialLocale] || {})[ns] || {}
)
})
I'll need someone to provide a reproducible repository.
I've been struggling with this since migrating over to the beta branch a few weeks ago (https://github.com/isaachinman/next-i18next/issues/869#issuecomment-767923052). I have tried a few times to identify why, and fix it myself, but without any success.
I put together this minimum reproduction real quick that is also failing to load fallbackLngs. Hope it helps! https://github.com/dmeents/fallback-ignored-example
Thanks for the repro, @dmeents. This is indeed a genuine bug, and I will fix it immediately.
A couple things to note:
next-i18next to automatically set fallbackLng if the user doesn't pass a value, or false (to disable)fallbackLng as an array. I haven't written support for this yet, but would accept a PR from any user who desires this functionality