You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
should make me navigate to the correct localized route.
Current Behavior
When a single-locale country object is added, when clicking on the link to change language, the page breaks and the following error message is displayed: Unexpected Server Error Error: Objects are not valid as a React child (found: Error: Cannot read properties of undefined (reading 'split')). If you meant to render a collection of children, use an array instead.
The console says TypeError: Cannot read properties of undefined (reading 'split') and the part where the error tends to show up is the anchor with the recommended locale url link in root.tsx:
I think the problem is that this assumes that the locale will look like "languagecode-countrycode", i.e., "it-it" instead of simply "it". I was very opinionated since I was building for countries with the same language in different regions, like "de-ch" (German in Switzerland) and "de-de" (German in Germany). So I think if you just change the locale to "it-it", the split("-")[1] should stop throwing an error. I'll fix this in the meantime!
Expected Behavior
Adding a single locale inside a country in
/utils/i18n.ts
, both with the same key, such asshould make me navigate to the correct localized route.
Current Behavior
When a single-locale country object is added, when clicking on the link to change language, the page breaks and the following error message is displayed:
Unexpected Server Error Error: Objects are not valid as a React child (found: Error: Cannot read properties of undefined (reading 'split')). If you meant to render a collection of children, use an array instead.
The console says
TypeError: Cannot read properties of undefined (reading 'split')
and the part where the error tends to show up is the anchor with the recommended locale url link inroot.tsx
:Steps to Reproduce
utils/i18n.ts
and addit: { it: "Italiano (Italia)"},
to thelocales
npm run dev
Context (Environment)
I discovered this issue while trying to add also Italian translations to a website I am building with Remix.run
My setup is the following:
The text was updated successfully, but these errors were encountered: