Features
Configurations

Languages & International

Supported languages

SparkLayer supports a range of languages and when a customer signs in, they'll see the appropriate language native to your store. SparkLayer currently supports the following languages:

Variable

Language

en

English (default)

ar

Arabic (with full RTL support)

zh

Chinese

hr

Croatian

cs

Czech

da

Danish

nl

Dutch

fi

Finnish

fr

French

de

German

el

Greek

he

Hebrew (with full RTL support)

hu

Hungarian

it

Italian

jp

Japanese

lt

Lithuanian

no

Norwegian

pt

Portugese

ro

Romanian

ru

Russian

sk

Slovak

es

Spanish

sv

Swedish

By default, SparkLayer automatically detects the default language of your store but it is possible manually overwrite this if required with the modification of the language variable in the SparkLayer Core Script.

JS


Need a language not listed above? If you require a language that isn't on our list, please contact us and we can send details on how to supply translations.



Locale configuration

SparkLayer provides an intuitive formatting system for dates and currency symbols by utilising the locale of the user's browser. This ensures dates and currency symbols are displayed according to the user's regional setting, enhancing the user experience.

However, if you prefer to implement a standard formatting across your user base, SparkLayer offers the option to set a specific locale. By adjusting the locale option, you can establish a fixed format for all of your users, irrespective of their individual browser settings.

JS


The locale option requires a string input, comprised of a combination of a language code and a two-letter country code, delineated by a hyphen (-).

  • For instance, to set the locale for British English, you would use 'en-GB'
  • For American English, 'en-US'
  • For Australian English, 'en-AU'
  • For German 'de-DE'
  • etc

This format ensures that the chosen locale accurately reflects both the language and the regional conventions for date formatting and currency symbols.

For your B2B pricing, any currency prefixes will be removed and instead default to the locale you've set. For example, if you set the locale to locale: 'en-US', this would remove the US prefix before your pricing.

Document image


The locale option only affects the formatting of prices, not the values.





Text and language overwrites

SparkLayer uses "language strings" to render the text used in the Frontend Interfaces and any string can be modified with custom text (i.e. overwritten).

If you're wanting to update specific text elements, it's possible to turn on a special setting within the SparkLayer Core Script that exposes specific code snippets that you can then reference with your overwrites.

JS


When this setting is enabled, the SparkLayer interface will then render the special language code snippets. In our example below, you can see the language code for the Product Page Interface

Document image


Please note We recommend enabling this setting temporarily or onto a non-published theme to ensure it isn't seen by your logged in B2B customers.

Modifying languages

To overwrite the text, you need to add specific code snippets to the SparkLayer Core Script. In our example video below, we've shown how to temporarily switch on the special showTranslations setting (see above) and adding text overwrites for RRP pricing.



The formatting works by 'cascading' the variables. For example, in the code below, you can see how the pdp.table.price text has been included.

JS


Some important items to note:

  • The variable en must be replaced with the specific language of your store (see our supported languages with their special codes)
  • The text overwrites must always end the line with a comma

Updating text that contains dynamic variables

For some text content, SparkLayer includes dynamic variables, such as pack sizing or special settings.

Document image


Dynamic variables are always wrapped in 'camel case' , for example {packSize} and you can find a list of all dynamic text below:

JS