How can I customise translations for my shop?

How-To: How can I customise translations for my shop?

Important note for developers and shop owners who use bespoke templates

To use this functionality you must have the generic template version 11 installed (or greater). Please see Template Version Control for more information on the generic template version.

It is possible to customise default locale files via the PTMT starting from a generic version 11.

If you have not worked with the PTMT before, please read:

- How can I upgrade a bespoke template to the latest version of the generic template?
Using a bespoke design template

To download the Template Management Tool, please go to the Swifty Developer Community at http://developer.gplshops.com.  Full instructions on how to work with the Swifty Template Management Tool are available on the Swifty platform Developer Community.

Once you’ve logged into the PTMT, please click ‘Download Template’ and save a file to your local drive. Locale files subfolders for all 28 languages can be found under “static/messages/” folder.

Each locale subfolder contains 2 locale files - JS and XML. Locale subfolders and locale files follow a naming convention which includes a Language Code based on a country that a subfolder and 2 locale files are associated with. Please see a table of Languages and associated Language Codes below.


Language  Language Code
Arabic     ar
Czech    cz
Danish     da
Dutch    nl
English       en
Farsi      fa
Finnish     fi
French       fr
German     de
Hebrew    iw
Hindi      hi
Hungarian       hu
Italian       it
Japanese     ja
Korean      ko
Norwegian    no
Polish     po
Portuguese       pt
Romanian       ro
Russian      ru
Simplified Chinese      sc
Spanish     es
Swahili    sw
Swedish       sv
Thai       th
Traditional Chinese      tc
Urdu      ur
Vietnamese      vi

Locale JS and XML include the following textual resources that can be customised:

-    Front end textual resources
-    Standard client and server side messages generated by the Swifty platform
-    Content of the following customer facing emails:

  • Customer registration confirmation email
  • Reset password email
  • Customer tracking order status email
  • Order confirmation email
  • Ukash new voucher email (only used when a Ukash payment method has been added for a shop)
  • Order payment failure email (not in use at the moment - reserved for future implementation)
A merchant can add new message keys when editing FTLs and include them together with associated copy into a locale XML file.

Please note, if a certain message key cannot be found in the locale XML file on a shop template level when the webpage renders, it will be searched for in the locale XML file on generic and then on application level. If a message key is not found in the XML locale on application level, it will be searched in the default XML locale (English) on application level.

Once you complete the changes to locale JS and XML files, upload them to a shop by clicking on the Update Template button in the PTMT and publish the site for the changes to be applied online.

Please note locale XML file size should not exceed 512Kb.

Maintaining bespoke locale files for your shop
Going forward, bespoke JS and XML locale files need to be merged with the latest generic locale files during each upgrade of a bespoke template to the latest version of the generic template. This is to make sure that your bespoke JS and XML locale files contain new message keys and JS messages.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.