Contents

Localisation

 

You can change the language and formatting of field names and messages displayed by your checkout in the browser, to better suit the needs of your international customers. Read on to learn how.

 


 

Locale

By updating the payload within the JWT to include the locale field, you can easily update your checkout to display text according to the locale specified. This includes:

locale requires a language and country to be specified, in the format shown below. We support the following locales:

locale value Description
cy_GB Welsh, United Kingdom
da_DK Danish, Denmark
de_DE German, Germany
en_US English, United States
en_GB English, United Kingdom
es_ES Spanish, Spain
fr_FR French, France
nl_NL Dutch, The Netherlands
no_NO Norwegian, Norway
sv_SE Swedish, Sweden

 


{"payload":{"accounttypedescription":"ECOM","baseamount":"1050","currencyiso3a":"GBP","sitereference":"test_site12345","credentialsonfile":"1","locale":"de_DE"},"iat":1559033849,"iss":"jwt.user"}

 

 

Custom translations

You can also specify custom translations for messages displayed at the top of the form following a successful transaction or if an error occurs. This will override the default messages displayed.

Tick

Advantages:

  • Translate messages into languages we don’t currently accept as a supported locale (as listed above).
  • Provide alternative wording to the default phrases returned (e.g. to better reflect your brand’s voice).
  • Provide additional info that may be specific to your business (e.g. including an order reference).

 

Update your payment form

You will need to update your payment form to contain the dictionary translations. Within this dictionary, you can specify multiple keys, each of which is a message that can be returned by our JavaScript Library. For each message specified in the keys, you will then need to provide a corresponding translation that will override them.


<html>
<head>
</head>
<body>
  <div id="st-notification-frame"></div>
  <form id="st-form" action="https://www.example.com" method="POST">
    <div id="st-card-number" class="st-card-number"></div>
    <div id="st-expiration-date" class="st-expiration-date"></div>
    <div id="st-security-code" class="st-security-code"></div>
    <button type="submit" id="st-form__submit" class="st-form__submit">
      Pay securely
    </button>
  </form>
 <script src=<DOMAIN>/js/v2/st.js></script>
 <script> 
  (function() {
   var st = SecureTrading({  
    jwt: 'INSERT YOUR JWT HERE',
    translations:{'An error occurred': 'INSERT YOUR TRANSLATION HERE'},
    });  
   st.Components(); 
  })(); 
 </script>
</body>
</html>

 

Here is the full list of phrases for which custom translations can be specified:
Important: These are case sensitive.