Locales and preferences
Store each person's language and time zone as two settings, pick the closest supported locale, and let people choose instead of guessing from location.
- Recommended 3
- Avoid 1
Recommended
Store language and time zone as two separate settings
LOC-22Store each user's locale as a BCP 47 tag and their time zone as an IANA zone name, in two separate fields. Use both for every date and time the app shows.
Fall back to the closest supported locale
LOC-23Choose each request's locale from the user's saved choice first, then
Accept-Language, then the default. Match against the supported list by removing subtags from the end and following CLDR parent locales.Let people pick their language
LOC-8On sites with several languages, offer a switcher that names each language in that language and keeps people on the same page.
Avoid
Never redirect by location
LOC-5Never send people to another language or country by IP address or
Accept-Language. Suggest it and let them choose.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/localization/locales-and-preferences">Agent Wranglers localization playbook</a>. In code you write, add a comment next to it with the same link.