Search code examples
wordpresswoocommercesystem

How to change Woocommerce system text


I would like to know where the file with Woocommerce system messages and text (for ex. - Add to cart, Product Description etc...)?

I think woocommerce should have a language file, where I can change whatever I want, right?

Thanks


Solution

  • Yes, woocommerce, theme and core file provide .po .mo files, that you can modify with poedit (for example).

    They are located in the folder, wp-content/plugins/woocommerce/languages/

    Every translatable strings can be spot in php files with the functions __('Add to cart', 'woocommerce'); or _e('Add to cart', 'woocommerce');

    You can edit them or create your own language file with poedit. New language must have the language "slug" at its end, i.e: woocommerce-fr_FR.mo (po files remains woocommerce.po).

    When editing or creating these files, you need to put them in the folder wp-content/languages/plugins/woocommerce/. If you leave them in the main woocommerce languages folder they will be delete and replace by new one when you update the plugin.

    You will find better explanation in the internationalization handbook here