Skip to content
IvaSure add-ons and services for SureCart storesJoin the POD waitlist

The language switcher

2 min read
Published

A shopper needs one obvious control to change language. The add-on ships one, and it works with the block editor, a shortcode, your navigation menu, or as a floating pill.

A rounded language switcher showing a flag and the word English, opened to reveal a list with the Romanian flag beside Romana, the Russian flag beside Russkiy, and the American flag beside English, which is highlighted as current.
The switcher open on the storefront.

Placing it

RouteUse
BlockSearch for IvaSure: Language Switcher in the block inserter.
Shortcode[ivasure_language_switcher] anywhere a shortcode runs.
Navigation menuSet placement to menu and pick a menu location - your theme then owns the position, including how it collapses on a phone.
FloatingSet placement to float and choose a corner. Nothing to edit in a template.
Block themes register no menu locations
If your theme is a block theme there is nothing for the menu placement to attach to. Use the block - you can put it in the header template part and get the same result with more control.

The floating placement offers four corners: top right, top left, bottom right and bottom left. It clears announcement bars at the bottom of the screen rather than sitting on top of them.

The five display modes

ModeShows
Flag and nameThe default. A flag and the language’s own name.
FlagThe flag alone.
Flag and codeA flag and the locale code.
CodeThe code alone.
NameThe name alone, no flag.
A flag is a country, not a language
Flag-only is the most compact mode and the least clear one: Spanish is not Spain, English is not the United States, and a shopper who does not recognise a flag has nothing else to go on. The accessible name always carries the full language name, so a screen reader is fine - it is sighted shoppers who lose the information. Prefer a mode that includes the name unless space genuinely will not allow it.

Language names are always shown in their own language - Romana, not Romanian - because a shopper looking for their language is looking for the word they use for it.

What it does when used

  • Choosing a language navigates to the same page with ?ks_lang= set.
  • The choice is remembered for the rest of the visit.
  • The switcher relabels itself to the current language.
  • The whole control is a native disclosure, so it works with the keyboard and without JavaScript.
Compact on small screens
Below 782px the name is dropped and a short code takes its place, so the control stays tappable without pushing the rest of your header off the screen.

Save to list