I have inserted the string to translate into the app/i18n/lg_lG.csv file. I run the command to deploy static files, clean cache, but the string is not translated. The string is located in this file:

    <p class="field note" data-bind="text: isVirtual ? $t('Enter your billing address to get a tax estimate.') : $t('Enter your destination to get a shipping estimate.')"></p>

The magento verion is 2.3.1 .


Run the following command

rm-rf /var/view_processed pub/static/frontend/Vendor/Custom_theme/lg_lG/js-translations.json

php bin/magento setup:static-content:deploy -f lg_LG

php bin/magento cache:clean

php bin/magento cache:flush

Visit js-translations.json file in browser.

Visit your site.

  • it doesn't work! – blob Aug 2 '19 at 10:18
  • I manually edited the js-translations.json file! If it is deleted I replace with the old one and it is done! – blob Aug 2 '19 at 13:32

Try replacing text: with i18n:, this is the translation binding although I don't know how that will work with your inline logic. IMO that is more suited to being in the JS file.

See https://devdocs.magento.com/guides/v2.3/ui_comp_guide/concepts/knockout-bindings.html#i18n for more info

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.