I need to translate the frontend of magento 2 to pt_BR, but I'm having a problem to translate the strings that are generated by the JS/KO. All my pages are translated normally with the .csv, but the JS/KO strings aren't. For example, I want to translate the button "GO TO CHECKOUT" from mini-cart, but I can't... How can I get it ? Anyone have any ideia to solve this ? I already flush the cache, run the command bin/magento setup:static-content:deploy, but didn't work for me.
Check if the file pub/static/frontend/<Vendor>/<theme>/<locale>/js-translation.json
exists and if it only contains []
.
If so, you've been affected by a Magento 2 bug (js-translation.json
not being generated properly).
The workaround is to remove this file and run php bin/magento setup:static-content:deploy <locale>
. This should populate the file and make JS/KO translations work. You may also want to change file permissions on js-translation.json
to prevent Magento from overwriting it again with []
.
Source: https://github.com/magento/magento2/issues/2056#issuecomment-259641599
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With