cancel
Showing results for 
Search instead for 
Did you mean: 

Translate parts of shop and theme

Translate parts of shop and theme

Hi all,

I'm quit new to Magento 2. My questions is how do I translate my theme and other parts of my shop? I'm using the Dutch tranlation for Magento itself but still the theme needs to be translated. What it the easiest way and how can I keep my translation save for future updates?

Regards Rob

4 REPLIES

Re: Translate parts of shop and theme

You have to just create  nl_NL.csv file into your theme i18n folder.

app/design/frontend/{Vendorname}/{themename}/i18n/nl_NL.csv

 Check links,

https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/translate_theory.html

 

You can translate string inside template file using php,

<?php __('translate word');?>

You can translate knockout js file using i18n,

    <span data-bind="i18n: 'Sign In'"></span>

You can translate xml using translate="true",

    <item name="label" xsi:type="string" translate="true">Delete</item>

For js file translation,

Use the $.mage.__('') function when adding a string:

	$.mage.__('<string>');

https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/xlate.html

 

https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/translations/translate_practice.html

If Issue Solved, Click Kudos/Accept As solutions.

Re: Translate parts of shop and theme

Hi @Jojobaa

 

If you wanted to make your shop front in Dutch language - then First you need to installed Dutch language translation package(Ignore if you have already installed) ! 

 

How to install dutch language translation package , follow this link - https://www.mageplaza.com/magento-2-dutch-language-pack.html

 

so automatically - few translation will be covered by installing this package !

 

Few translations are still missing which you have added as custom - so for that you need to override this language pack in your custom theme here is the full path - app/design/frontend/VENDORNAME/THEMENAME/i18n/nl_NL.csv

 

So add the rest of the translations over here , run deploy command again and check it will works !

 

 

 

if issue solved,Click Kudos & Accept as Solution

Re: Translate parts of shop and theme

Ok thanks I will look into this. I'll let you guys know if I still have some questions ;-). So far, thanks for the support.

Re: Translate parts of shop and theme

Hi @Jojobaa

 

Sure , Not an issue ! try it and let us know if you still have any issue on the same 

if issue solved,Click Kudos & Accept as Solution