Change English text strings from plugins in WordPress (NOT translation)

I've spent several hours on a simple answer to this question, to no avail. I 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 detect text string changes in WordPress for English. There are no second languages ​​on the site, I just want to change one English string for another English string (for example, change "coupon code" to "discount code"). I would like there to be a standard way of doing this, either manually by placing the files in wp-content / languages, or using a plugin that provides an admin interface for editing mo / po files.

CodeStyling localization is recommended by WooCommerce for editing its text strings - it lists all .mo / .po files and allows you to edit .po and then restore .mo. However, this does not have a noticeable impact on the site.

To summarize the situation (I am using the latest versions of all mentioned plugins and WP core):

  • WordPress installed with no language defined in wp-config.php (this means it defaults to en_US or en_GB - I can't detect that either)? UPDATE: I now bind to the en_GB specification in wp-config.php, so I can be sure what works in WordPress)
  • WooCommerce is installed and uses the _e () function for all text strings
  • The CodeStyling localization is installed and I have successfully edited the en_GB mo / po files and saved and restored them.
  • I have confirmed via FTP that the .po file shows the converted text strings after saving
  • None of the text lines have been updated on the interface
  • I tried to define 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 ignores the mo / po files because it thinks there is no need for translation because WooCommerce is in English and so I install Wordpress so we go around the translation files completely.
  • There's confusion between en_US and en_GB, which means the converted strings are not loaded (maybe the site is en_US, but editing mo / po changes en_GB, so it doesn't apply)

Can anyone shed some light on this?

thank

+3


source to share


1 answer


I found the problem: the WPML plugin (which is a translation plugin that supports WooCommerce and multiple currencies) was included solely for currency support (not for translations), but had its own default English set in en_US (which overloaded my wp -config en_GB ). This meant that none of my changes to en_GB mo / po files for WooCommerce worked. As soon as I fixed the WPML locale for English to en_GB, the changes appeared.



+1


source







All Articles