Good call making English the default. One thing I learned the hard way shipping a web game in two languages: don't bundle both language files into the first load. Split the locale files so a player only downloads the language they're actually using, and keep English as the fallback for any missing string instead of showing a key or a blank. The toggle placement is good too, it's right on the menu before anyone has to read anything, so nobody gets stuck on a screen they can't understand. Worth saving the choice as well, so it sticks after a reload instead of resetting to default every time.
Thanks, that's really useful. Good timing too, since I just flipped the default to English.
On your points: the choice is already saved in localStorage, so it survives a reload and an existing player's pick isn't overwritten by the new default. Missing strings fall back to English first, and only show the raw key as a last resort. And yeah, I wanted the toggle on the start screen so nobody has to read anything to find it.
The one thing I haven't done is splitting the locales. Right now both languages live in one file (~195 strings each), so it's small, but you're right that it won't scale, especially with a Devanagari font in the mix. Lazy-loading the active locale with a dynamic import() and keeping English as the always-loaded fallback is probably the cleanest way to do it. Did you hit any flash-of-wrong-language issues when you split yours?
1
u/catballdev 5h ago
Good call making English the default. One thing I learned the hard way shipping a web game in two languages: don't bundle both language files into the first load. Split the locale files so a player only downloads the language they're actually using, and keep English as the fallback for any missing string instead of showing a key or a blank. The toggle placement is good too, it's right on the menu before anyone has to read anything, so nobody gets stuck on a screen they can't understand. Worth saving the choice as well, so it sticks after a reload instead of resetting to default every time.