News for hackers. Stuff that matters.
Re:Ask HN: Those making $500/month on side projects in 2021 ... by TheHippo on Thursday December 23, 2021 @09:53PM (#29669509)
Don't determine the users language by the country the request is coming from. My browser wants English, despite me being in Germany, so don't show me the German page. The good thing though was that besides the language selector nothing else was translated.
Re:Ask HN: Those making $500/month on side projects in 2021 ... by niftylettuce on Friday December 24, 2021 @03:20PM (#29677345)
It actually doesn't determine it by the country the request is coming from.

How it works is fully documented here: https://github.com/ladjs/i18n#i18nmiddlewarectx-next

1) Check URL (e.g. if /de or /de/ then it's a de locale - as long as de is a supported locale)

2) Use the custom function (if provided by the detectLocale parameter) for locale detection

3) Check the "locale" cookie value (or whatever the cookie option is defined as)

4) Check Accept-Language header

Regarding nothing being translated, there was an issue with our locales folder sync and that's being resolved soon!