#Invisible Internationalization?
11 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
You can do it like you would do dark mode
I use next-themes for dark mode. But you mean storing the language info in the local storage as i18n usually does that? Can I just use i18n as it usually works on normal React projects?
Or can I maybe use the approach Next.js features in their documentation but cookie-based rather than URL-based?
I don’t know how i18n “usually works” on normal react projects, so can’t comment on that.
A typical i18n solution would rely on the url to provide locale information, but since you want it to be invisible that’s not applicable.
Then the only way to do it is by using a state-based solution. Which is like the way you would handle theming.
That said, just don’t. The locale params provide language info not only to users but to search engines as well - you don’t want to prevent German version of your pages from showing on Google right? Secondly, to resolve the problem of sharing URLs, you can simply handle redirection when an incoming request has the locale different from the expected language in the header
Putting the locale in the url is an established good practice and you should follow that
SEO doesn't matter for this since it won't show up in search engines either way. That's why I'm focusing on usability which would be better if there was no language in the URL
If I share a YT link with you, you don't want to suddenly have your YouTube switch to german because the URL says so. That's what I want to prevent here
YouTube locale depends on the user settings. If you want to do it the YouTube way, you need to save the preferred locale into the database, but then it will be simple won’t it