I have spent hours scouring for a simple answer to this question, to no avail. I’ve tried three translation plugins also to no avail (WPML, CodeStyling Localization and Loco Translate).
All i want to do is provide my client with a way to define text string changes in WordPress for English. There are NO second languages on the site, I simply want to change one English string for another English string (e.g. change “coupon code” to “discount code”). I would have that there is a standard way to do this, either manually by placing files in wp-content/languages, or by using a plugin that provides an admin interface to edit mo/po files.
CodeStyling Localization is recommended by WooCommerce for editing its text strings – it lists all .mo/.po files and lets you edit the .po then regenerate the .mo. This has no discernible effect on the site, though.
To summarise the situation (i am using latest versions of all mentioned plugins and the WP core):
- WordPress is installed with no language definition in wp-config.php (does this mean it defaults to en_US or en_GB – I can’t seem to discover that either)? UPDATE: I’ve stuck to specifying en_GB in wp-config.php now so I can be sure of the language WordPress is running in)
- WooCommerce is installed and uses the _e() function for all text strings
- CodeStyling localization is installed, and I have successfully edited to en_GB mo/po files and saved and regenerated them
- I have confirmed via FTP that the .po file shows the converted text strings once saved
- None of the text strings have updated on the frontend
- I have tried defining the site language as en_GB in wp-config.php to force the en_GB mo/po files to be loaded for woocommerce, to no avail
All I can guess is that:
- The site is ignoring the mo/po files because it thinks there’s no “translation” needed because WooCommerce is in English and so is my wordpress install – so it’s bypassing the translation files completely
- There’s a confusion between en_US and en_GB meaning the converted strings aren’t loading (maybe the site is en_US but the mo/po i am editing is en_GB, so it’s not applying them)
Can anybody shed any light on this?
Thanks
I found the problem: the WPML plugin (which is a translation plugin that supports WooCommerce and multiple currencies) was enabled purely for currency support (not for translations), but had its own default English set to en_US (which overrode my wp-config en_GB settings). This meant none of my changes to en_GB mo/po files for WooCommerce were working. As soon as i corrected WPML’s locale for English to en_GB, the changes showed up.