Klarna Docs - Locale and display language
Locale and display language

This article describes the locale settings in the Klarna On-site messaging Shopify app and how the settings affect the display language of the placements.

By default, the locale of placements in the Klarna On-site messaging (OSM) Shopify app is set to the dynamic locale configuration option, Geolocation.

When you choose the Geolocation option, you can display a single On-site messaging placement in a different language, based on the customer’s geolocation. The customer's country determines the On-site messaging placement's data-locale attribute. The language is selected from the list of languages matching the locale, either using the Shopify storefront language or the browser's language, based on the Ad Position's configuration setting, and injected into the klarna-placement HTML element on the storefront page.

If the customer's selected language isn’t supported for the country, English is used as a fallback. You can check the locale set for the placement by opening the web browser’s Developer tools > Elements menu and searching for klarna-placement.

If you’re testing geolocation when your computer isn’t located in the desired test region, you can use a VPN or manually set your desired region by entering the following code in your browser's Developer tools > Console and reloading the page for the change to take effect.

JAVASCRIPT
window.localStorage.setItem('klarnaosm_user_locale', 'SE')

The developer tools' Console lets you manually set a specific locale in your storefront.

If you’re using the Geolocation locale setting in a store that has the base currency of EUR, for Klarna On-site messaging using Online Store 2.0 App Blocks, the enabled EURO countries are shown by default. However,  you can manually configure the locale to be used for all Klarna On-site messaging App Blocks in your Shopify Admin > Apps > Klarna On-Site Messaging > App Block Instructions.

The following static locale configuration options are available:

  • for Online Store 2.0 App Blocks, Manual locale
  • for vintage ad positions, Auto select and Select locale

To summarize:

  • The Klarna On-site messaging (OSM) Shopify app offers dynamic locale settings, allowing placements to be displayed in different languages based on the customer's geolocation.
  • There are also options for manually setting the locale or using automatic selection for different ad positions and app blocks.