-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localisation #491
Comments
Test: https://localisation-test--gravitongame.netlify.com/ curl -v -H "Accept-Language: en-in" https://localisation-test--gravitongame.netlify.com
curl -v -H "Accept-Language: en-gb" https://localisation-test--gravitongame.netlify.com
curl -v -H "Accept-Language: en-us" https://localisation-test--gravitongame.netlify.com
curl -v -H "Accept-Language: hi-in" https://localisation-test--gravitongame.netlify.com |
Nice! The only worry I have around multiple, separate builds is ServiceWorker and the caches. For example, each language will have their own sprite textures that will get redownloaded when I switch languages, no? Or can we dedupe those across builds? |
They're duped in the build, but (assuming their content is the same) they'll have the same URL at the end. It could be a build optimisation though. I guess the point is, hashed assets do not need But yeah, we'll have to trigger sprite regeneration on language change (assuming numbers are different). I'll have a think about the service worker behaviour here. Maybe forcing a reload in this case is a better option. |
The plan is to use
Accept-Language
+ Netlify's rewrite rules. https://www.netlify.com/docs/redirects/#geoip-and-language-based-redirects. It says 'redirect' here, but if you use 200 as the status code, it'll rewrite rather than redirect.You can also set an
nf_lang
cookie, so we have a path to a language picker.The idea is just to do multiple builds of the site.
Where Rollup will make
:lang:
an import like:And it'll just do a build per language pack.
We need to make sure we set
Vary
headers on all content.We need to avoid the subsetted font trick for non-English (unless we do similar subsetting).
We probably need to rethink the font all together for non-latin script.
The text was updated successfully, but these errors were encountered: