2

I'm trying to change "Excl. Tax:" to "Excl. Vat:" and have created a CSV file called en_GB.csv which contains the line - "Tax:", "Vat:".

I've saved and uploaded this to app/design/frontend/Magento/luma/i18n/en_GB.csv.
The translation hasn't worked as my store still shows "Excl. Tax".
I've deployed static files and run the upgrade command too.
Not too sure what to try next?

3

If the manual translation doesn't work, you can try Magento generation of translation dictionary by collecting translatable phrases in Magento 2.3.x.

Since you are configuring a Magento store in en_GB language. You can collect translatable phrases through this command:

php bin/magento i18n:collect-phrases --output "app/i18n/Magento/en_GB.csv" --magento  

After running the above command, you can check and open the file with the collected translatable phrases from this path app/i18n/Magento/en_GB.csv
From there you can find and replace every "Excl. Tax" translatable phrase.
After you finish changing those words, you should run below command:

php bin/magento i18n:pack app/i18n/Magento/en_GB.csv -d en_GB  

Flush cache. And your changes will reflect in the frontend.

  • @Eddie did you try this one? – fmsthird Apr 10 at 5:13
  • Yes I've tried this command but get the following error 'Cannot open file for write dictionary: "app/i18n/Magento/en_GB.csv"' I'm still looking in to it as with other methods. I finding there is lots of conflicting information online with how this should be done. – Eddie Apr 13 at 3:36
  • 1
    Please ignore the comment above. I thought the command created the en_GB.csv file. When I created the empty file with that path you suggested and run the command it returned the translatable phrase. Using find and replace I changed tax to vat and it worked – Eddie Apr 13 at 5:02
1

You need to use full phrase (this one was without ":") :

"Excl. Tax","Excl. Vat"

because it's

data-label="<?php echo $block->escapeHtml(__('Excl. Tax'));?>">

and if You translate for options:

"Excl. Tax:","Excl. Vat:"

its always need to be exact phrase.

Another example from Module_Tax

"Excl. tax:","Excl. VAT:"

Remember to not add spaces between ","

  • Is my path to my file en_GB.csv and file name correct as I've changed the text to "Excl. Tax:", "Excl. Vat" and it hasn't changed the display on my store – Eddie Apr 8 at 6:06
  • Yes its correct if You use luma theme, if you use your custom app/design/frontend/YourVendor/YourTheme/i18n/en_GB.csv , only one line is needed "Excl. Tax", "Excl. Vat" , if you dont need any more translations – BartZalas Apr 8 at 21:26
  • This is my path app/design/frontend/Magento/luma/i18n/en_GB.csv and I've tried both "Excl. Tax:, Excl. Vat:" & "Excl. Tax, Excl. Vat" (with and without the :'s). I run the commands php bin/magento setup:upgrade & php bin/magento setup:static-content:deploy -f and the store still shows "Excl. Tax:" is there any other command I need to use? – Eddie Apr 9 at 4:47
  • Do You use inline Magento translation overwrites? Its translation from backend? You can try clean manually cache and later deploy rm -rf var/cache/* var/page_cache/* var/session/* var/view_preprocessed/pub/static/* pub/static/frontend/* generated/code/* – BartZalas Apr 9 at 12:31
  • One more thing. Be sure that you dont have spaces between comma "," I literally had this problem now with "My Wish List","My Favourites" Your example is with space also. – BartZalas Apr 9 at 14:25

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.