{"playbook":"Localization","url":"https://agentwranglers.se/playbook/localization","updated":"2026-10-22","license":"https://creativecommons.org/licenses/by/4.0/","credit":"Required by the licence: credit Agent Wranglers with a link to the rule or playbook you used.","ids":"Each rule has an id, such as PAY-14, that never changes. Open a rule by its id at /r/PAY-14. Its revision changes whenever its content changes.","how":"Each rule's How and Measured text is on its own page: add .md to its url.","rules":[{"id":"LOC-23","revision":"432bcb171acc","updated":"2026-10-22","name":"Fall back to the closest supported locale","level":"Recommended","rule":"Choose 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.","check":"A unit test resolves `pt-AO`, `zh-Hant-TW`, `de-CH` and `xx` against the supported list. Each gets the expected locale, and `xx` gets the default.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/locales-and-preferences/locale-fallback","related":["/playbook/localization/locales-and-preferences/language-switcher","/playbook/localization/messages-and-translation/default-messages","/playbook/localization/apis-and-data/response-language","/playbook/localization/apis-and-data/translated-content-storage"],"sources":["https://www.rfc-editor.org/rfc/rfc4647#section-3.4","https://www.unicode.org/reports/tr35/tr35.html","https://www.w3.org/International/questions/qa-accept-lang-locales"]},{"id":"LOC-8","revision":"2bf5067b972d","updated":"2026-10-22","name":"Let people pick their language","level":"Recommended","rule":"On sites with several languages, offer a switcher that names each language in that language and keeps people on the same page.","check":"From any page, each switcher link leads to the same page in the other language and answers 200.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/locales-and-preferences/language-switcher","related":["/playbook/notifications/channels-and-preferences/recipient-language","/playbook/localization/locales-and-preferences/locale-fallback","/playbook/localization/locales-and-preferences/avoid-auto-geo-redirects"],"sources":["https://www.w3.org/International/questions/qa-navigation-select"]},{"id":"LOC-5","revision":"a405fa1c8ae5","updated":"2026-10-22","name":"Redirecting by location","level":"Avoid","rule":"Never send people to another language or country by IP address or `Accept-Language`. Suggest it and let them choose.","check":"Request each page with several `Accept-Language` values and no cookies. Every answer is 200 with the same canonical address, never a 3xx.","check_type":"http","url":"https://agentwranglers.se/playbook/localization/locales-and-preferences/avoid-auto-geo-redirects","related":["/playbook/localization/locales-and-preferences/language-switcher","/playbook/ecommerce/carts-and-checkout/geo-blocking-access"],"sources":["https://developers.google.com/search/docs/specialty/international/locale-adaptive-pages","https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites","https://eur-lex.europa.eu/eli/reg/2018/302/oj"]},{"id":"LOC-13","revision":"8993e3664cc1","updated":"2026-10-22","name":"Translate whole sentences","level":"Recommended","rule":"On sites with several languages, or one planned, keep every visible text in a message file. Use one entry per whole sentence with named placeholders, and never build a sentence from translated pieces.","check":"A lint rule finds no text in templates outside the message calls. A test finds no message that is joined to another with `+` or string formatting.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/whole-sentence-messages","related":["/playbook/stack/web-frameworks/formatjs-gettext","/playbook/localization/messages-and-translation/plural-rules","/playbook/localization/messages-and-translation/extract-messages","/playbook/localization/formatting/list-and-duration-formats","/playbook/localization/apis-and-data/error-codes-for-translation"],"sources":["https://www.unicode.org/reports/tr35/tr35-messageFormat.html"]},{"id":"LOC-12","revision":"2ee8e1fbde22","updated":"2026-10-22","name":"Get plurals right in every language","level":"Recommended","rule":"Choose plural forms from the language's CLDR plural rules, for cardinal counts and for ordinals such as \"1st\" and \"2nd\", instead of adding an \"s\".","check":"A unit test runs the counts 0, 1, 2, 3, 5, 11, 21 and 22 for each language, as cardinals and as ordinals. Each picks the expected category and message. A test fails when a translation lacks a category the language uses.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/plural-rules","related":["/playbook/app-ui/dates-and-numbers/relative-times","/playbook/notifications/channels-and-preferences/recipient-language","/playbook/stack/web-frameworks/formatjs-gettext","/playbook/localization/messages-and-translation/whole-sentence-messages","/playbook/localization/messages-and-translation/select-messages","/playbook/localization/messages-and-translation/translation-completeness"],"sources":["https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html","https://tc39.es/ecma402/#pluralrules-objects","https://www.unicode.org/reports/tr35/tr35-messageFormat.html"]},{"id":"LOC-24","revision":"06e9a833a0f4","updated":"2026-10-22","name":"Choose gender and other variants inside the message","level":"Recommended","rule":"When a sentence changes with a person's gender, a role or another fixed choice, put every variant in one message with a `select` argument. Never pass a translated word into a placeholder.","check":"A unit test formats each message that has a `select` with every listed keyword and with an unknown value. Each output is a full sentence, and the unknown value uses the `other` branch.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/select-messages","related":["/playbook/localization/messages-and-translation/plural-rules"],"sources":["https://unicode-org.github.io/icu/userguide/format_parse/messages/","https://www.unicode.org/reports/tr35/tr35-messageFormat.html"]},{"id":"LOC-25","revision":"03f2759de977","updated":"2026-10-22","name":"Ship a default text for every message","level":"Required","risk":"outage","rule":"Every message key has a text in the default language, and a missing translation falls back to it key by key at run time. A missing text never stops a screen from loading.","check":"A test deletes one key from a non-default language and renders every screen in that language. Each screen loads and shows the default text for that key. A second test finds every key used in the code in the default language file.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/default-messages","related":["/playbook/localization/messages-and-translation/extract-messages","/playbook/localization/locales-and-preferences/locale-fallback","/playbook/localization/messages-and-translation/translation-completeness","/playbook/localization/apps-and-command-line-tools/platform-string-resources","/playbook/localization/language-laws/nordic-public-sector-language"],"sources":["https://developer.android.com/guide/topics/resources/localization"]},{"id":"LOC-18","revision":"68f3338c272c","updated":"2026-10-22","name":"Extract messages from the code with a tool","level":"Recommended","applies":["team"],"rule":"Build the source message file from the code with an extraction tool, never by hand. CI fails when the committed file differs from a fresh extraction.","check":"CI runs the extractor and then `git diff --exit-code` on the source message file. A message added to the code without a new extraction fails the build.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/extract-messages","related":["/playbook/stack/web-frameworks/formatjs-gettext","/playbook/localization/messages-and-translation/default-messages","/playbook/localization/messages-and-translation/whole-sentence-messages"],"sources":["https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html"]},{"id":"LOC-19","revision":"a1944b80db85","updated":"2026-10-22","name":"Fail the build on missing or broken translations","level":"Recommended","rule":"Before release, every key in the source exists in each published language, and every translation has the same placeholders as its source.","check":"A test loads each published language. Every source key is present, every message parses, and the set of placeholders in each translation equals the set in its source.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/translation-completeness","related":["/playbook/localization/messages-and-translation/default-messages","/playbook/localization/messages-and-translation/plural-rules","/playbook/localization/messages-and-translation/stale-translations"],"sources":["https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html"]},{"id":"LOC-20","revision":"8b9e0fe6f532","updated":"2026-10-22","name":"Mark translations stale when the source changes","level":"Recommended","rule":"When a source sentence changes, mark its translations as needing review in every language. A stale translation is never published as current.","check":"A test changes one source sentence and runs the update step. That key is marked stale in every language, and the completeness check reports it.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/stale-translations","related":["/playbook/localization/messages-and-translation/translation-completeness","/playbook/documentation/keeping-docs-current/stale-translation-banner","/playbook/localization/apis-and-data/translated-content-storage","/playbook/customer-support/macros-and-help-articles/help-content-with-releases"],"sources":["https://www.gnu.org/software/gettext/manual/html_node/Fuzzy-Entries.html","https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html"]},{"id":"LOC-21","revision":"a76f50ac292d","updated":"2026-10-22","name":"Give translators context and a review step","level":"Recommended","rule":"Every message carries a note for translators, and every translation, human or machine, is reviewed by a fluent speaker before release.","check":"A test finds a translator note of at least 20 characters on every source message. Each published language file names a reviewer for its last change.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/translator-context","related":["/playbook/localization/layout-and-scripts/pseudo-localisation","/playbook/localization/messages-and-translation/machine-translation-glossary","/playbook/localization/layout-and-scripts/text-expansion","/playbook/localization/apps-and-command-line-tools/platform-string-resources","/playbook/localization/email-notifications-and-ai/ai-evals-per-language"],"sources":["https://developer.android.com/guide/topics/resources/localization","https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html"]},{"id":"LOC-47","revision":"b4caa89f9c64","updated":"2026-10-22","name":"Escape translated text like user input","level":"Required","risk":"takeover","rule":"Insert every translated message into a page as text, escaped by the template. Allow markup in a message only through named tags that the code maps to elements.","check":"A test replaces every message in one locale with `<img src=x onerror=alert(1)>` and loads each page. No dialog opens and the tag shows as text. A search finds no message lookup passed to an HTML sink.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/escape-translations","related":["/playbook/application-security/input-and-injection/cross-site-scripting"],"sources":["https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html"]},{"id":"LOC-57","revision":"0e0a5e2b6b81","updated":"2026-10-22","name":"Machine-translate with a glossary and a do-not-translate list","level":"Recommended","rule":"Give every machine translation engine a glossary per language and a list of terms it must never translate. A test checks each translated message against both.","check":"A test reads every translated message. Each do-not-translate term in the source appears unchanged, each glossary term uses its listed translation, and every placeholder in the source is present.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/messages-and-translation/machine-translation-glossary","related":["/playbook/localization/messages-and-translation/translator-context"],"sources":["https://cloud.google.com/translate/docs/advanced/glossary"]},{"id":"LOC-11","revision":"70c2e7c2b5d9","updated":"2026-10-22","name":"Format every date and amount from the reader's locale and zone","level":"Recommended","rule":"Format dates, numbers and money for the reader's locale with a formatting library. Show times with a named time zone.","check":"A unit test formats a fixed date and amount for each supported locale. The output matches the expected strings.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/formatting/locale-content","related":["/playbook/app-ui/dates-and-numbers/user-time-zone","/playbook/api-design/requests-and-responses/dates-and-times","/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences","/playbook/localization/formatting/hand-written-date-patterns","/playbook/localization/apis-and-data/locale-neutral-api-values"],"sources":["https://tc39.es/ecma402/","https://cldr.unicode.org/"]},{"id":"LOC-26","revision":"dd246fd2dcf0","updated":"2026-10-22","name":"Writing date formats by hand","level":"Avoid","rule":"Never build a date for people from a hand-written pattern such as `MM/dd/yyyy`. Ask the formatter for a style or a skeleton, and let the locale data order the fields.","check":"A search of the code finds no date pattern with `Y` in a formatter call, and no pattern string outside data and log code. A unit test formats 29 December 2025 in every supported locale and gets the year 2025.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/formatting/hand-written-date-patterns","related":["/playbook/api-design/requests-and-responses/dates-and-times","/playbook/localization/formatting/locale-content"],"sources":["https://www.unicode.org/reports/tr35/tr35-dates.html"]},{"id":"LOC-27","revision":"e57655def962","updated":"2026-10-22","name":"Take the currency from the amount and not from the locale","level":"Required","risk":"money","applies":["payments"],"rule":"Format every price with the currency code stored with that amount. The reader's locale chooses only the separators and the symbol position.","check":"A test renders the cart, the checkout and the receipt for a SEK order in the `en-US`, `de-DE` and `ja-JP` locales. Every amount shows SEK and the charged number. A search finds no currency formatter call without an explicit currency.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/formatting/currency-from-the-amount","related":["/playbook/payments/amounts-and-orders/money-in-minor-units","/playbook/api-design/requests-and-responses/money","/playbook/payments/currencies-and-settlement/price-per-currency"],"sources":["https://tc39.es/ecma402/#numberformat-objects"]},{"id":"LOC-28","revision":"66e6d8907704","updated":"2026-10-22","name":"Read the week start and units from locale data","level":"Recommended","rule":"Read the first day of the week, the weekend, the 12 or 24 hour clock and the measurement system from CLDR locale data. Never hard-code them.","check":"A component test renders the date picker in `sv-SE`, `en-US` and `ar-EG`. The first column is Monday, Sunday and Saturday.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/formatting/week-and-units-from-cldr","related":["/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences"],"sources":["https://www.unicode.org/reports/tr35/tr35-dates.html","https://tc39.es/ecma402/"]},{"id":"LOC-51","revision":"5e568c6b391a","updated":"2026-10-22","name":"Format lists and durations with locale data","level":"Optional","rule":"Join visible lists with a locale list formatter and format durations with a locale duration formatter. Never join with a hard-coded comma and \"and\".","check":"A unit test formats `[\"A\", \"B\", \"C\"]` in `en`, `es` and `ja` and gets `A, B, and C`, `A, B y C` and `A、B、C`. A search finds no `join(', ')` on visible text.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/formatting/list-and-duration-formats","related":["/playbook/localization/messages-and-translation/whole-sentence-messages"],"sources":["https://tc39.es/ecma402/"]},{"id":"LOC-55","revision":"579eab856228","updated":"2026-10-22","name":"Show and accept phone numbers in each country's format","level":"Recommended","rule":"Accept phone numbers as people write them in their country. Show each one in the reader's national or international format with a phone number library.","check":"A unit test parses \"070-123 45 67\" with the country SE and gets `+46701234567`. It formats that number back as \"070-123 45 67\" for SE and as \"+46 70 123 45 67\" for other countries.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/formatting/phone-number-formats","related":["/playbook/notifications/text-messages/e164-phone-numbers"],"sources":["https://www.itu.int/rec/T-REC-E.164"]},{"id":"LOC-53","revision":"d37a7ff9044d","updated":"2026-10-22","name":"Keep text in UTF-8 at every layer","level":"Required","risk":"data","stack":["postgres"],"rule":"Store, send and read all text as UTF-8 in every layer, from forms and APIs to the database, files, email and exports. In MySQL and MariaDB use `utf8mb4`, never `utf8`.","check":"A round-trip test sends \"Åsa Ødegård 😀 中文\" through a form, the API, the database, an export and an email. Every copy reads back byte for byte the same. A schema test finds `utf8mb4` on every text column, and the CSV export starts with the bytes `EF BB BF`.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/text-handling/utf8-everywhere","related":["/playbook/website/html-basics/meta-charset"],"sources":["https://encoding.spec.whatwg.org/","https://www.rfc-editor.org/rfc/rfc3629","https://dev.mysql.com/doc/refman/8.4/en/charset-unicode-utf8mb4.html"]},{"id":"LOC-15","revision":"ebb7646be314","updated":"2026-10-22","name":"Sort and compare text by locale","level":"Recommended","rule":"Sort, compare and search visible text with a collator for the reader's locale. Normalise it first, as the normalisation rule says.","check":"A unit test sorts a fixed list per locale and gets the expected order. Swedish puts \"ä\" after \"z\", and German puts it after \"a\". A search for \"resume\" with the English locale finds \"résumé\".","check_type":"static","url":"https://agentwranglers.se/playbook/localization/text-handling/locale-collation","related":["/playbook/data/operations/collation-versions","/playbook/app-ui/lists-and-tables/server-sort-and-filter","/playbook/localization/text-handling/unicode-normalisation","/playbook/localization/text-handling/grapheme-clusters","/playbook/search/language-and-matching/search-language","/playbook/search/language-and-matching/compound-words"],"sources":["https://www.unicode.org/reports/tr10/","https://www.unicode.org/reports/tr15/"]},{"id":"LOC-29","revision":"d291e8281a4b","updated":"2026-10-22","name":"Change the case of identifiers without a locale","level":"Required","risk":"outage","rule":"Lower-case and upper-case keys, protocol words, file extensions and identifiers with locale-independent functions. Use locale-aware case only for text shown to people.","check":"Run the test suite with the default locale set to Turkish, such as `-Duser.language=tr` for Java or `LC_ALL=tr_TR.UTF-8`, and it passes. A lint rule finds no locale-dependent case call on a key, header or enum.","check_type":"http","url":"https://agentwranglers.se/playbook/localization/text-handling/locale-independent-case","related":["/playbook/accounts/sign-up/identifier-normalisation","/playbook/localization/text-handling/unicode-normalisation"],"sources":["https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt","https://tc39.es/ecma262/#sec-string.prototype.tolowercase"]},{"id":"LOC-16","revision":"0d2dd31ffbd2","updated":"2026-10-22","name":"Accept names and addresses from every country","level":"Recommended","rule":"Let people enter names and addresses as they are written in their country. Never reject letters, word counts or field shapes your own country does not use.","check":"A form test submits \"José O'Brien-Núñez\", \"李小龙\" and the single name \"Suharto\", each with an address in Hong Kong, which has no postal codes. Every one is accepted and stored unchanged.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/text-handling/international-names-and-addresses","related":["/playbook/notifications/text-messages/e164-phone-numbers","/playbook/ecommerce/shipping-and-delivery/delivery-address-check"],"sources":["https://www.w3.org/International/questions/qa-personal-names","https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill"]},{"id":"LOC-50","revision":"8dffd5688843","updated":"2026-10-22","name":"Count and cut text by visible characters","level":"Recommended","rule":"Count characters for length limits, and cut previews, by extended grapheme clusters. Keep a byte limit for storage beside it.","check":"A unit test cuts `👩‍👩‍👧 home` to 1 character and gets `👩‍👩‍👧`. The form counter shows 1 for `e` followed by a combining acute accent.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/text-handling/grapheme-clusters","related":["/playbook/localization/text-handling/locale-collation","/playbook/localization/layout-and-scripts/scripts-fonts-and-line-breaks"],"sources":["https://www.unicode.org/reports/tr29/","https://tc39.es/ecma402/"]},{"id":"LOC-54","revision":"a8e4d55f7d35","updated":"2026-10-22","name":"Normalise text before you compare or store it","level":"Recommended","rule":"Normalise user text to NFC before you store, search or compare it. Compare identifiers, such as usernames and handles, in their NFKC case-folded form.","check":"A unit test saves \"e\" plus U+0301 and finds the record by searching \"é\". Signing up as \"ＡＬＩＣＥ\" when \"alice\" exists is refused.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/text-handling/unicode-normalisation","related":["/playbook/localization/text-handling/locale-collation","/playbook/localization/text-handling/locale-independent-case","/playbook/accounts/sign-up/reserved-names"],"sources":["https://www.unicode.org/reports/tr15/","https://www.unicode.org/reports/tr39/"]},{"id":"LOC-22","revision":"d837bc06c933","updated":"2026-10-22","name":"Store language and time zone as two separate settings","level":"Recommended","rule":"Store 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.","check":"A test creates a user with locale `sv-SE` and zone `Asia/Tokyo`. The same stored instant renders in Swedish words at Tokyo time on the screen, in the email and in the PDF.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences","related":["/playbook/localization/formatting/locale-content","/playbook/localization/formatting/week-and-units-from-cldr","/playbook/data/schema-design/exact-types","/playbook/api-design/requests-and-responses/dates-and-times","/playbook/app-ui/dates-and-numbers/user-time-zone","/playbook/localization/apps-and-command-line-tools/per-app-language","/playbook/localization/email-notifications-and-ai/localized-email","/playbook/localization/email-notifications-and-ai/ai-reply-language","/playbook/customer-support/macros-and-help-articles/macro-placeholders"],"sources":["https://www.rfc-editor.org/rfc/rfc5646","https://www.iana.org/time-zones"]},{"id":"LOC-46","revision":"8e3567b9ac9a","updated":"2026-10-22","name":"Keep the time zone database current in every runtime","level":"Recommended","rule":"Every server, container and runtime that converts times runs the latest IANA tz release within 30 days of its publication.","check":"A CI job reads the tz release each service reports and compares it with `https://data.iana.org/time-zones/tzdb/version`. It fails when a service runs an older release more than 30 days after the newer one came out.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/time-and-time-zones/time-zone-database-updates","related":["/playbook/localization/time-and-time-zones/future-local-times"],"sources":["https://www.iana.org/time-zones","https://data.iana.org/time-zones/tz-link.html"]},{"id":"LOC-48","revision":"82cfae9fcffe","updated":"2026-10-22","name":"Store future local times as a local time and a zone name","level":"Recommended","rule":"Store a future appointment, opening hour or reminder as its local date and time plus an IANA zone name. Compute the UTC instant only when you need it.","check":"A schema test finds a zone-name column beside every column of future local times. An API test sends `2027-03-02T09:00:00+01:00[Europe/Stockholm]` and reads back the same string.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/time-and-time-zones/future-local-times","related":["/playbook/app-ui/dates-and-numbers/calendar-dates","/playbook/localization/time-and-time-zones/time-zone-database-updates","/playbook/testing/unit-tests/daylight-saving-tests"],"sources":["https://www.rfc-editor.org/rfc/rfc9557","https://www.iana.org/time-zones"]},{"id":"LOC-49","revision":"00c0cda53cb9","updated":"2026-10-22","name":"Name the time zone of every day boundary","level":"Recommended","rule":"Every daily limit, billing period, report day and \"today\" in the code takes its time zone from configuration or from the account. None takes it from the server clock.","check":"A search finds no `date.today()`, `setHours(0)` or start-of-day call without a zone argument. A unit test resets a daily cap for an account in `Australia/Sydney` at local midnight.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/time-and-time-zones/day-boundary-time-zone","related":["/playbook/pricing/spend-caps-and-alerts/customer-spend-cap"],"sources":[]},{"id":"LOC-30","revision":"31305a338188","updated":"2026-10-22","name":"Let every layout grow with the longest translation","level":"Recommended","rule":"Give text room to grow. No text container has a fixed width or height, and every screen is tested with the longest translation of each message.","check":"The browser or UI tests run once in a locale built from the longest translation of every key, at phone width. No text is cut off, overlaps or scrolls sideways.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/text-expansion","related":["/playbook/localization/messages-and-translation/translator-context","/playbook/localization/layout-and-scripts/pseudo-localisation"],"sources":["https://www.w3.org/International/articles/article-text-size"]},{"id":"LOC-14","revision":"1cd3db2d7f70","updated":"2026-10-22","name":"Test with a pseudo-locale","level":"Recommended","rule":"When a site will be translated, build a pseudo-locale that makes every text longer and accented. Run the page tests in it before any translation exists.","check":"The browser tests pass in both pseudo-locales. A test finds no visible text node without the brackets, and no element that scrolls sideways.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/pseudo-localisation","related":["/playbook/localization/messages-and-translation/translator-context","/playbook/localization/layout-and-scripts/text-expansion","/playbook/app-ui/tests-and-budgets/visual-regression","/playbook/localization/layout-and-scripts/input-composition"],"sources":["https://learn.microsoft.com/en-us/globalization/methodology/pseudolocalization","https://developer.android.com/guide/topics/resources/pseudolocales"]},{"id":"LOC-9","revision":"8b290752db71","updated":"2026-10-22","name":"Support right-to-left text","level":"Recommended","rule":"Support right-to-left languages with `dir`, logical CSS properties and `dir=\"auto\"` on user input.","check":"Load a page with `dir=\"rtl\"`. Nothing overlaps or scrolls sideways, and icons that point a direction are mirrored.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/rtl-support","related":["/playbook/email/message-basics/language-and-direction","/playbook/localization/layout-and-scripts/bidi-isolation","/playbook/localization/layout-and-scripts/writing-modes","/playbook/accessibility/seeing-and-reading/sensory-characteristics"],"sources":["https://html.spec.whatwg.org/multipage/dom.html#the-dir-attribute","https://www.w3.org/TR/css-logical-1/"]},{"id":"LOC-31","revision":"625bc13816b6","updated":"2026-10-22","name":"Isolate inserted text from the text around it","level":"Recommended","rule":"Wrap every inserted value whose direction you do not know, such as a user name or a product title, in a direction isolate. Use `<bdi>` or `dir=\"auto\"` in HTML, and the Unicode isolate characters in plain text.","check":"A test renders \"{name} wrote 5 reviews\" with the name \"مطعم السلام\" in an English page. The words \"wrote 5 reviews\" stay in order after the name, and the value sits inside a `bdi` element or between U+2068 and U+2069.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/bidi-isolation","related":["/playbook/localization/layout-and-scripts/rtl-support"],"sources":["https://www.w3.org/International/articles/inline-bidi-markup/","https://www.w3.org/International/questions/qa-bidi-unicode-controls","https://www.unicode.org/reports/tr9/"]},{"id":"LOC-10","revision":"00034bd0aa35","updated":"2026-10-22","name":"Support vertical and CJK text","level":"Optional","rule":"Where Chinese, Japanese or Korean (CJK) text appears, support vertical writing and their line breaking with `writing-mode` and the right line-break rules.","check":"Text in the CJK pages breaks between phrases, and vertical blocks read top to bottom, right to left.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/writing-modes","related":["/playbook/localization/layout-and-scripts/rtl-support"],"sources":["https://www.w3.org/TR/css-writing-modes-4/","https://www.w3.org/TR/css-text-4/#valdef-word-break-auto-phrase","https://developer.chrome.com/blog/css-i18n-features"]},{"id":"LOC-52","revision":"d814c70ef6bd","updated":"2026-10-22","name":"Wait for text composition to end before acting on Enter","level":"Recommended","rule":"Ignore Enter and other shortcut keys while an input method is composing text. Send a message or run a search only after composition ends.","check":"A browser test dispatches `keydown` Enter with `isComposing: true` in the message field, and no message is sent. The same key with `isComposing: false` sends it.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/input-composition","related":["/playbook/localization/layout-and-scripts/pseudo-localisation"],"sources":["https://www.w3.org/TR/uievents/#keys-IME"]},{"id":"LOC-56","revision":"c76e5ca5dd23","updated":"2026-10-22","name":"Cover every script with fonts and break words with a segmenter","level":"Recommended","rule":"For each supported language, load or fall back to a font with all its characters, and set `lang` on the page. Find word boundaries with a segmenter, never by splitting on spaces.","check":"A unit test segments \"สวัสดีครับ\" with the Thai locale and gets more than one word. A browser test renders a sample sentence in every supported language at phone width, and a screenshot shows no missing-glyph boxes.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/layout-and-scripts/scripts-fonts-and-line-breaks","related":["/playbook/localization/text-handling/grapheme-clusters"],"sources":["https://www.unicode.org/reports/tr29/","https://www.unicode.org/reports/tr14/","https://tc39.es/ecma402/#segmenter-objects"]},{"id":"LOC-1","revision":"b41e5f8d0bc2","updated":"2026-10-22","name":"Give each language its own path","level":"Recommended","rule":"On sites with several languages, give each language one clear address pattern, such as `/en/` and `/sv/`, and keep it stable. A one-language site needs no prefix.","check":"A test lists every page. Each address carries exactly one known language in the chosen pattern, and no address has a `lang` query parameter.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/international-url-structure","related":["/playbook/localization/multilingual-websites/hreflang","/playbook/localization/email-notifications-and-ai/localized-email","/playbook/localization/language-laws/quebec-french","/playbook/seo/site-structure/url-structure"],"sources":["https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites"]},{"id":"LOC-2","revision":"444800e83412","updated":"2026-10-22","name":"Link language versions together","level":"Recommended","rule":"On sites with several languages, link each language version of a page to the others with `hreflang`. A one-language site should not use it.","check":"A test reads every page's `hreflang` links. Each target answers 200, is canonical to itself, and links back.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/hreflang","related":["/playbook/localization/multilingual-websites/international-url-structure","/playbook/localization/multilingual-websites/sitemap-hreflang","/playbook/seo/site-structure/url-structure"],"sources":["https://developers.google.com/search/docs/specialty/international/localized-versions","https://www.rfc-editor.org/rfc/rfc5646"]},{"id":"LOC-3","revision":"4604f93d7d5f","updated":"2026-10-22","name":"Translate the metadata too","level":"Recommended","rule":"Set the language in `lang`, `og:locale` and `inLanguage` in structured data, and write alt text in that language.","check":"A test reads each language version. `lang`, `og:locale` and `inLanguage` agree, and the title differs from the default language.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/localised-metadata","related":["/playbook/accessibility/seeing-and-reading/image-alt-text","/playbook/website/html-basics/html-lang"],"sources":["https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes","https://schema.org/inLanguage"]},{"id":"LOC-4","revision":"7e47bd7e17b7","updated":"2026-10-22","name":"List language versions in the sitemap","level":"Optional","rule":"On sites with several languages, list each page's language versions in the sitemap with `hreflang`.","check":"The sitemap validates, and every version listed for a `url` lists the same set of versions. Where pages also carry `hreflang` links, the sitemap lists the same set as the HTML.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/sitemap-hreflang","related":["/playbook/localization/multilingual-websites/hreflang"],"sources":["https://developers.google.com/search/docs/specialty/international/localized-versions#sitemap"]},{"id":"LOC-6","revision":"098620cab88e","updated":"2026-10-22","name":"Mark foreign words","level":"Required","risk":"law","rule":"Mark every passage in another language with its own `lang` attribute.","check":"An accessibility checker such as axe reports no `valid-lang` failures. A test keeps a list of the foreign phrases the site uses, and finds each one inside an element with a matching `lang`.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/lang-attribute","related":["/playbook/email/message-basics/language-and-direction","/playbook/localization/multilingual-websites/translate-attribute"],"sources":["https://www.w3.org/TR/WCAG22/#language-of-parts","https://www.rfc-editor.org/rfc/rfc5646"]},{"id":"LOC-7","revision":"f72346c3d752","updated":"2026-10-22","name":"Keep names out of machine translation","level":"Optional","rule":"Protect names, code and addresses from machine translation with `translate=\"no\"`.","check":"A test finds `translate=\"no\"` on every `code` element and every element that holds the brand name or an email address.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/translate-attribute","related":["/playbook/localization/multilingual-websites/lang-attribute"],"sources":["https://html.spec.whatwg.org/multipage/dom.html#attr-translate"]},{"id":"LOC-17","revision":"9c278e33eb40","updated":"2026-10-22","name":"Make non-ASCII domains work","level":"Optional","rule":"If you use a domain name with non-Latin or accented letters, make its punycode form work everywhere the name appears.","check":"`curl -sI https://xn--bcher-kva.example/` answers 200 with a valid certificate. A unit test converts `Bücher.example` to `xn--bcher-kva.example` and back.","check_type":"http","url":"https://agentwranglers.se/playbook/localization/multilingual-websites/idn-support","related":["/playbook/email/message-basics/international-addresses"],"sources":["https://www.rfc-editor.org/rfc/rfc5891","https://www.unicode.org/reports/tr46/","https://www.rfc-editor.org/rfc/rfc6531"]},{"id":"LOC-32","revision":"5dfcaa2440db","updated":"2026-10-22","name":"Send raw values with standard codes instead of formatted text","level":"Recommended","rule":"API fields and stored data hold raw values in standard forms. Languages are BCP 47 tags, countries are ISO 3166-1 alpha-2 codes, and numbers are JSON numbers. Formatting for people happens only in the client.","check":"A contract test validates every response against the schema. Language fields match a BCP 47 pattern, country fields match `^[A-Z]{2}$`, and no string field holds a formatted number, date or amount.","check_type":"http","url":"https://agentwranglers.se/playbook/localization/apis-and-data/locale-neutral-api-values","related":["/playbook/api-design/requests-and-responses/dates-and-times","/playbook/api-design/requests-and-responses/money","/playbook/localization/formatting/locale-content"],"sources":["https://www.rfc-editor.org/rfc/rfc5646"]},{"id":"LOC-33","revision":"ff7c4169cd94","updated":"2026-10-22","name":"Answer human-readable text in the language the client asked for","level":"Recommended","applies":["public-api"],"rule":"When an API returns text for people, choose its language from an explicit setting or parameter first, then `Accept-Language`. Answer with `Content-Language`, and add `Accept-Language` to `Vary` when it chose the language.","check":"Request the same endpoint with `Accept-Language: de` and with `sv`. Each answer has the matching `Content-Language`, the text differs, and `Vary` lists `Accept-Language`.","check_type":"http","url":"https://agentwranglers.se/playbook/localization/apis-and-data/response-language","related":["/playbook/localization/locales-and-preferences/locale-fallback"],"sources":["https://www.rfc-editor.org/rfc/rfc9110#section-12.5.4","https://www.rfc-editor.org/rfc/rfc9110#section-8.5","https://www.rfc-editor.org/rfc/rfc9110#section-12.5.5"]},{"id":"LOC-34","revision":"9902e8dca517","updated":"2026-10-22","name":"Give every error a code that clients can translate","level":"Recommended","rule":"Every error carries a stable code and the values a client needs to build its own message. The code never changes with the language, and only the human text is translated.","check":"A test triggers each error with `Accept-Language: en` and with `de`. The `type`, pointer and values are equal in both answers, and only `title` and `detail` differ.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/apis-and-data/error-codes-for-translation","related":["/playbook/api-design/errors/stable-error-types","/playbook/localization/messages-and-translation/whole-sentence-messages"],"sources":["https://www.rfc-editor.org/rfc/rfc9457#section-3.1"]},{"id":"LOC-35","revision":"b2b33ba04cc0","updated":"2026-10-22","name":"Store translated content per record and language","level":"Recommended","rule":"Store translatable content, such as product names and descriptions, in rows keyed by the record and a BCP 47 tag. Never add one column per language.","check":"A query lists records that lack a translation in a published language. The list is empty, or each missing row falls back to the default language in the API.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/apis-and-data/translated-content-storage","related":["/playbook/localization/locales-and-preferences/locale-fallback","/playbook/localization/messages-and-translation/stale-translations","/playbook/localization/language-laws/product-safety-language"],"sources":[]},{"id":"LOC-36","revision":"8acfd306b6d2","updated":"2026-10-22","name":"Keep app strings in the platform's resource files","level":"Recommended","rule":"Phone and desktop apps keep every visible text in the platform's resource format, with plural variants, and never as text in the code. A lint check fails on hard-coded text.","check":"Android Lint runs with `HardcodedText` and `MissingTranslation` as errors and passes. On Apple platforms, the build shows no String Catalog entry marked stale or new in a shipped language.","check_type":"static","url":"https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/platform-string-resources","related":["/playbook/localization/messages-and-translation/translator-context","/playbook/localization/messages-and-translation/default-messages"],"sources":["https://developer.android.com/guide/topics/resources/localization","https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog"]},{"id":"LOC-37","revision":"ce8be73006d9","updated":"2026-10-22","name":"Support the system's per-app language setting","level":"Recommended","rule":"Declare every language the app ships so iOS and Android list it in the system's per-app language setting. An in-app language picker opens that setting or uses the platform API, instead of a separate home-made switch.","check":"On a test device with Android 13 or later, the app's system settings page lists every shipped language. Choosing one restarts the app in it. On iOS, the app's Settings page shows a Language row that lists every shipped language.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/per-app-language","related":["/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences","/playbook/localization/apps-and-command-line-tools/localized-store-listings"],"sources":["https://developer.android.com/guide/topics/resources/app-languages","https://developer.apple.com/videos/play/wwdc2024/10185/","https://developer.apple.com/videos/play/wwdc2019/403/"]},{"id":"LOC-38","revision":"ef635c30ad21","updated":"2026-10-22","name":"Translate the store listing for every language the app ships","level":"Recommended","rule":"Each language the app ships has a store listing in that language, with name, short description, full description, keywords and screenshots. The listing never claims a language the app does not have.","check":"A CI test compares the listing folders with the app's shipped languages. Each language has every listing field and at least one screenshot, and no folder exists for a language the app lacks.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/apps-and-command-line-tools/localized-store-listings","related":["/playbook/localization/apps-and-command-line-tools/per-app-language"],"sources":["https://developer.apple.com/help/app-store-connect/manage-app-information/localize-app-information/","https://support.google.com/googleplay/android-developer/answer/9844778"]},{"id":"LOC-40","revision":"9d2c85cc67fd","updated":"2026-10-22","name":"Translate every part of an email","level":"Recommended","applies":["email"],"rule":"Render the subject, preview text, sender name, HTML part, plain-text part and footer of each email in the recipient's stored language. The links in it open pages in that language.","check":"A test sends each email template to a German test recipient. The subject, preview text, both bodies and the footer contain no source-language message, and every link to your own site starts with `/de/`.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/email-notifications-and-ai/localized-email","related":["/playbook/notifications/channels-and-preferences/recipient-language","/playbook/localization/multilingual-websites/international-url-structure","/playbook/email/message-basics/language-and-direction","/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences"],"sources":[]},{"id":"LOC-41","revision":"24cd48524aa4","updated":"2026-10-22","name":"Tell the model which language to answer in","level":"Recommended","applies":["ai-features"],"rule":"Name the user's language in the system prompt of every AI feature, and check that each answer is in that language before showing it.","check":"An eval case sends English input for a user whose language is German. The language detector labels the answer `de` in at least 19 of 20 runs.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/email-notifications-and-ai/ai-reply-language","related":["/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences","/playbook/ai-features/prompts-as-code/prompts-in-files"],"sources":["https://platform.claude.com/docs/en/build-with-claude/multilingual-support"]},{"id":"LOC-42","revision":"ee0e71a75860","updated":"2026-10-22","name":"Run the evals in every language you support","level":"Recommended","applies":["ai-features"],"rule":"Run the eval set for each AI feature in every supported language, and report the pass rate per language. A release fails when any language drops below its threshold.","check":"The eval report lists a pass rate for every supported language. CI fails when any language is below its threshold or has fewer than 20 cases.","check_type":"command","url":"https://agentwranglers.se/playbook/localization/email-notifications-and-ai/ai-evals-per-language","related":["/playbook/localization/messages-and-translation/translator-context","/playbook/ai-features/evals-and-quality/evals-from-production"],"sources":["https://platform.claude.com/docs/en/build-with-claude/multilingual-support"]},{"id":"LOC-43","revision":"2793fe2e68cd","updated":"2026-10-22","name":"Show product safety information in the buyer's language","level":"Required","risk":"law","applies":["eu-users"],"region":["EU"],"rule":"When you sell physical products to EU consumers online, show each product's warnings and safety information in the language its country sets.","check":"A test lists every product offered in each EU country with warnings. Each has safety text in that country's required language on its product page, or is not offered there.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/language-laws/product-safety-language","related":["/playbook/localization/apis-and-data/translated-content-storage","/playbook/ecommerce/catalog-and-prices/sale-countries","/playbook/ecommerce/catalog-and-prices/product-offer-safety-details","/playbook/documentation/help-centres-and-user-guides/cra-user-information"],"sources":["https://eur-lex.europa.eu/eli/reg/2023/988/oj"]},{"id":"LOC-44","revision":"6a737a1676f3","updated":"2026-10-22","name":"Check each country's language rules for consumer contracts","level":"Recommended","applies":["eu-users"],"region":["EU"],"rule":"Before you sell to consumers in an EU country, write down whether its law sets a language for contract information and terms. Offer them in that language when it does.","check":"The country list has an entry with a source for every country in the checkout's country list. A test places an order in each shop language and finds the terms and confirmation in that language.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/language-laws/consumer-contract-language","related":["/playbook/payments/price-display-and-consumer-law/order-button-label"],"sources":["https://eur-lex.europa.eu/eli/dir/2011/83/oj"]},{"id":"LOC-45","revision":"350ea542067f","updated":"2026-10-22","name":"Offer French when you sell in Quebec","level":"Required","risk":"law","region":["CA-QC"],"rule":"When you sell to customers in Quebec, offer your commercial web pages, product information, software and standard contracts in French. The French version is at least as easy to reach and as complete as any other.","check":"A test lists every public page in the other languages. Each has a French version that answers 200, and the switch to French appears on every page. The checkout shows the terms in French first to a customer with a Quebec address.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/language-laws/quebec-french","related":["/playbook/localization/multilingual-websites/international-url-structure"],"sources":["https://www.legisquebec.gouv.qc.ca/en/document/cs/C-11","https://www.quebec.ca/nouvelles/actualites/details/infraction-a-la-charte-de-la-langue-francaise-le-site-web-de-lentreprise-quality-belt-maintenance-ltee-42492"]},{"id":"LOC-58","revision":"abd3a36d316e","updated":"2026-10-22","name":"Use the national languages in Swedish and Norwegian public services","level":"Required","risk":"law","region":["SE","NO"],"rule":"A service built for a Swedish public body is in Swedish. A service for a Norwegian state body offers its forms and self-service in both Bokmål and Nynorsk, released at the same time.","check":"For a Norwegian state body, a test lists every form and self-service page. Each answers 200 in `nb` and in `nn`, from the same release. For a Swedish public body, every page has `lang=\"sv\"` and Swedish text.","check_type":"manual","url":"https://agentwranglers.se/playbook/localization/language-laws/nordic-public-sector-language","related":["/playbook/localization/messages-and-translation/default-messages"],"sources":["https://www.riksdagen.se/sv/dokument-och-lagar/dokument/svensk-forfattningssamling/spraklag-2009600_sfs-2009-600/","https://lovdata.no/dokument/NL/lov/2021-05-21-42"]}]}