1

When translating a line in, for example, this path to the file the line is in:

vendor/magento/module-checkout/view/fontend/web/template/shipping-information.html

This will be the translation line:

"Example String","Voorbeeld String","module","Magento_Checkout"

But what if this is the path:

vendor/tig/buckaroo/view/frontend/web/template/payment/tig_buckaroo_ideal.html

What is the translation string in that case?


In my case, I want to translate "Select your bank" to "Selecteer uw bank". Normally, the format would be like this:

vendor/STORE/TYPE-LOCATION/etc....

And it would be added to the translation file like this:

"Select your bank","Selecteer uw bank","TYPE","STORE_LOCATION"

But, in this case, it is very different, because the path is not the default format for translating.

1

Create your translate (en_US.csv)file in below path :

/{magento 2 root folder}/app/design/frontend/{Vendor}/{theme name}/i18n/en_US.csv

Now add your translations in above created file.

  • I already did that (in my case nl_NL.csv). My question is, what should the string be? – Maarten Wolfsen Nov 8 '16 at 11:04
  • Please tell me exactly what you want?Suppose i want to translate "Shopping cart" to "Winkelmand" then add "Shopping cart" in left side and then "Winkelmand" in right side. – user46386 Nov 8 '16 at 11:07
  • I will add some details! – Maarten Wolfsen Nov 8 '16 at 11:12
5

When dealing with translations best way is to start with collecting translatable phrases, you can do so by issuing following command:

bin/magento i18n:collect-phrases --output "app/i18n/Vendorname/nl_NL.csv" --magento

This will collect all translatable phrases including ones from Modules in specified csv file along with their location.

Now you can find and replace (second instance only) ones which you want to translate and for house keeping get rid of the rest or leave them in, they do no harm. For example after issuing above command in my csv I see:

"Add New Banner","Add A Banner",module,Lof_Gallery

Where Add New Banner is translatable phrase of module Lof Gallery and I changed it to Add A Banner

Once finished translating issue coomand:

bin/magento i18n:pack app/i18n/Vendorname/nl_NL.csv -d nl_NL

This will deploy your translations to related modules. Clear cache and all that and it should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.