Language suggestions
The shell contract defines when a suggestion appears. The runtime contract defines storage and rendering. The multilingual guide covers site configuration.
Offer the translation at the article
A reader may arrive from search without having used the language menu. OINK offers a direct link to the same page in a preferred language. The notice uses that language for the sentence, link and close button. Site owners can disable it globally, on a section or on one page. The notice follows a blog hero and precedes a version notice. The language menu keeps its home-page fallback for manual navigation.
Resolve competing language preferences
For each preference, try its exact normalized tag and then the same language and writing system. The current page wins ties within a matching tier, followed by the site’s language order. Consider a different script only after exhausting the reader’s stronger matches. For preferences pa-PK, en, an English page with a pa-IN translation stays in English. With only zh-TW requested and only a zh-CN translation available on an English page, OINK can offer Simplified Chinese. An explicit choice leads the preference list.
Remember the reader’s action
Closing the Chinese suggestion on an English page silences that target across the origin. It gives no evidence that the reader wants an English suggestion on a Chinese page. Choosing Chinese later clears that dismissal. Each target has an independent record so tabs can dismiss different languages concurrently. Separate language domains keep independent preferences. A silent or unreadable store never prevents normal navigation.
Render with the article
An inline script after inert translation templates can insert the chosen notice before the parser reaches the article heading. A streamed navbar or hero may already have painted. The acceptance criterion concerns the first layout of the following article. The notice uses system fonts and wraps at narrow widths. An early close works while the page’s external scripts are still loading. Returning from the back/forward cache rechecks the stored decision.
Evidence checked on 2026-12-04
- Apple’s locale switcher filters page alternatives by the country in its
geocookie and uses the first two letters of the browser language to choose among same-country candidates. The Chinese, Japanese and US configurations set one dismissal and 30 days. The first opt-out check creates the record and starts the window. Closing later uses the time remaining. The script reads the cookie but does not establish how the server inferred it. The visible copy is localized, while the Chinese and Japanese wrapper labels are in English. Apple script · China configuration · Japan configuration · US configuration - GitHub Docs offers a translation on English pages with English copy. Its client checks the preference cookie, then the browser languages, taking the first supported two-letter code. Closing sets
user_language=enwith a 365-day expiry. A translated URL can temporarily serve English content, and unprefixed deep links also redirect according to preference. Notification · Language lookup · Cookie · Translation lag · Deep-link tests - Shopify’s retired Geolocation app suppressed accepted or dismissed country recommendations for 14 days. Language recommendations appeared each new session. The app closed on 2025-03-24. Shopify Help · Retirement notice
- WebKit can clear script-writable storage after seven days of Safari use without interaction with the site. Clicks, taps and keyboard entry qualify. Visits and scrolling alone do not reset the clock. Home Screen web apps have a first-party exemption. OINK’s 365 days is an application limit while the record survives. WebKit tracking prevention · Safari usage days