How to localize Javascript shopping cart

VirtoCommerce have a module that allows adding a basic shopping cart and checkout functionality to the website easily:
Integration sample could be found here:

Below I will guide you on how to localize the module content, e.g. Checkout form. Here is how it looks by default:

To add another language support, e.g. Russian, you need to do the following:

  1. Find and copy translations.js file, name copy ru.translations.js
  2. Change defined constant name to e.g. 'virtoCommerce.cartModule.ruTranslations', and use any translations you want:
  3. Add created localization object to the translations collection in cart.js:
  4. To use Russian translations by default, you could change preferred language to 'ru' in config section above:
  5. To switch between languages in runtime, you can call in your language switching handler:

After building and installing the module and restarting the platform, checkout form looks like this:

1 Like