Language switcher design: patterns that work on real sites
Put the switcher in the header, name each language in its own script, link to the same page in the other language, and skip flags and auto-redirects.
By Sohail Hussain21 November 20266 min read
Put the language switcher in the header, at the end of the bar, on every page. Name each language in its own language and script ("English", "العربية"), not with flags. Make it link to the same page in the other language, not to the other homepage. Keep it visible on mobile instead of hiding it inside the menu. Do not switch language automatically based on location or browser settings; offer the choice and remember it once someone makes it.
A bilingual site with a good switcher feels like one site in two languages. A bad switcher makes the second language feel like a separate, smaller site. It is one of the deliverables in our Arabic and multilingual websites service, and part of the wider setup in the guide to building an Arabic website.
Where should the language switcher go?
In the header, at the end of the bar. Visitors look for it at the top of the page, near the main menu or the contact button. On an English page that is the top right. On an Arabic page the whole header mirrors, so the switcher moves to the top left, which is the end of the bar in right-to-left reading. Keep it at the same logical position in both languages and it will be where people expect it.
Visible on mobile. For two languages the switcher is one short word. It fits in the mobile header beside the menu button. Burying it inside the hamburger menu hides it from exactly the people who need it, because someone who cannot read the current language is unlikely to open a menu they cannot read.
In the footer as well, if you like. A second link in the footer helps people who scroll to the bottom looking for it. It does not replace the header link.
The header has other jobs too, and adding a switcher to a crowded bar is one reason menus grow; website navigation covers how many items is too many.
How should the languages be labelled?
Each language in its own name. "English" on the Arabic page, "العربية" on the English page, "Français" for French. A reader who cannot read the current page can still recognise their own language.
Not flags. Flags stand for countries, not languages. Arabic is an official language in more than 20 countries; whichever flag you choose is wrong for most Arabic readers. The English flag problem is the same: a Union Jack or a US flag both suit some English readers and not others. Flags are right only in a country selector, where the choice really is about a country.
Codes alone are a compromise. "EN" and "AR" are widely understood and save space. "العربية" is still clearer for someone who reads only Arabic. If space is tight, use the code visually and give the link an accessible name with the full language name.
An icon helps; an icon alone does not. A globe or translate icon beside the label makes the control easy to spot. Without the label, it is a mystery button.
Mark up each label with its language, so screen readers switch pronunciation; website accessibility basics covers the wider rules. This is what WCAG means by language of parts:
<a href="/ar/services" hreflang="ar" lang="ar">العربية</a>
The lang attribute tells assistive technology how to read the text. The hreflang attribute on a link tells the browser the language of the page it leads to, which the W3C explains in its note on indicating the language of a link destination.
Which switcher pattern fits your site?
| Pattern | When it fits | Watch out for |
|---|---|---|
| Single link to the other language | Two languages; most bilingual sites | Nothing; it is the simplest and the best |
| Disclosure menu of links | Three or more languages | Build it from a button and a list of links, not a select box |
| Country and language selector | Stores with different prices, currencies or products per country | Keep country and language as separate choices |
| Full-page language chooser | Almost never | Adds a click before every first visit |
The select-box warning matters for accessibility. A select that loads a new page as soon as the value changes breaks keyboard use: in some browsers, pressing an arrow key to look through the options changes the value and triggers navigation on the first press. WCAG's success criterion on changes on input covers this. Use a button that opens a list of ordinary links.
A country selector is a different control from a language switcher. A store selling in the UAE and Saudi Arabia may need both: country decides currency, prices and delivery; language decides the text. A Saudi customer may want English, and a UAE customer may want Arabic.
Where should the switcher send people?
To the same page in the other language. Someone reading the English "Website maintenance" page who clicks العربية should land on the Arabic version of that page, not on the Arabic homepage, where they have to find it again in a language they may have only just switched to.
This needs a mapping from each page to its translation. Translation plugins and frameworks keep one. On a custom build, the same mapping drives both the switcher and the hreflang tags, so they always agree. Our hreflang tag generator shows the pairs a page should declare; the switcher should link to the same ones.
When a page has no translation:
- Hide or disable the switcher on that page, with a short note that the page is available in one language only; or
- Link to the closest translated page, such as the Arabic services section for an untranslated service page.
Never link to an error page. Keep the query string on listing and search pages, so a filtered product list stays filtered after switching.
Should the site choose the language automatically?
No. Detecting language from IP address or browser settings and redirecting gets it wrong often enough to matter. Many Arabic speakers in the Gulf use browsers set to English, and many English speakers browse from Arab countries. Google's guidance on managing multilingual sites advises against automatic redirection between language versions, because it can stop both users and search engines reaching all of them.
Two gentler approaches work:
- Suggest, do not redirect. If the browser's preferred language is Arabic and the visitor is on an English page, show a small dismissible bar: "هذه الصفحة متوفرة بالعربية" ("This page is available in Arabic"), with a link. The visitor stays where they are unless they choose to move.
- Remember an explicit choice. When someone clicks the switcher, store the choice in a cookie. Use it to pick the language when they next arrive at the bare homepage, and nowhere else. A link someone shares should always open in the language of the link.
How do you test a language switcher?
Run through this on every template, in both languages:
- Click the switcher and confirm you land on the equivalent page, then click back and return to where you started.
- Try a page with no translation and check the switcher behaves as designed.
- Use only the keyboard: tab to the switcher, open it, choose a language.
- Turn on a screen reader and listen to the label; "العربية" should be read in Arabic.
- Check it on a phone without opening the menu.
- Track switcher clicks as an analytics event, so you can see later whether people use it and from where.
On a Next.js site, the switcher can be a small client component that swaps the locale segment of the current path; building a multilingual Next.js site includes the code.
Was this guide useful?