docs
  1. Features
  2. Platform
  3. Localization

Localization

A storefront that sells in several countries shows each user their own language and currency, and offers the shop of their own country when they arrive on another one. In the Storefront Application V3 this is part of every page, set up per shop country: a country entry in storefront.config.ts plus a locale file. This page covers the two parts of that multi-country setup, internationalization and country detection.

Why it matters

A user expects the page in their language, with prices in their currency, and a user who lands on the wrong country shop through a shared link should find out before checkout. The language, the price format, and the canonical link come from the country the request belongs to, so they follow one setting instead of drifting apart across pages. The shop suggestion comes from the user's location, which Cloudflare sends in the CF-IPCountry header. A suggestion modal that the user can close keeps a user abroad on the shop they chose. Internationalization and Country Detection explain how each part works.

Try it

Try it: open the storefront in the United States (English)

Try it: open the storefront in Germany (German)

Recording of the demo shop in different countries and languages

What's included

  • Internationalization: Internationalization covers the locale files, the translation setup shared by server and browser, the currency and date formatting, and the canonical and hreflang links for every country.
  • Country Detection: Country Detection covers how the server reads the country of a request and how the browser offers the matching shop in a modal the user can close.