# How to localize Javascript shopping cart

**URL:** https://www.virtocommerce.org/t/how-to-localize-javascript-shopping-cart/122
**Category:** dev
**Created:** [December 19, 2019, 3:17pm UTC](https://www.virtocommerce.org/t/how-to-localize-javascript-shopping-cart/122 "2019-12-19T15:17:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yecli](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/yecli/32/87_2.png) [@yecli](https://www.virtocommerce.org/u/yecli)
#### Post date: [December 19, 2019, 3:17pm UTC](https://www.virtocommerce.org/t/how-to-localize-javascript-shopping-cart/122/1 "2019-12-19T15:17:05Z")

</div>

VirtoCommerce have a module that allows adding a basic shopping cart and checkout functionality to the website easily: [https://github.com/VirtoCommerce/vc-module-javascript-shoppingcart](https://github.com/VirtoCommerce/vc-module-javascript-shoppingcart).  
Integration sample could be found here:  
[https://github.com/VirtoCommerce/vc-samples/tree/master/JsShoppngCartIntergationSample](https://github.com/VirtoCommerce/vc-samples/tree/master/JsShoppngCartIntergationSample)

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/b045560c7f05360b9d8e5cae10b883e1cfb6f629.jpeg)

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

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/d8cedd94e8ab1b9929a2aef83bdc983749825561.png)  
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`  
 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/d5796e561f439c023a5d3c56b81b7bc3829b3978.png)
2. Change defined constant name to e.g. `'virtoCommerce.cartModule.ruTranslations'`, and use any translations you want:  
 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/eddb0a50f0a9405ebdd0eff795884462b4146058.png)
3. Add created localization object to the translations collection in `cart.js`:  
 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/d8870971535890a526d3570625306a714b47474f.png)
4. To use Russian translations by default, you could change preferred language to `'ru'` in config section above:  
`$translateProvider.preferredLanguage('ru');`
5. To switch between languages in runtime, you can call in your language switching handler:  
`$translate.use('ru');`

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

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/virtocommerce/original/1X/c86d02e1949f55caf7c6b33748fe128994290649.png)
