Plugin Author
Tim W
(@timwhitlock)
I recommend you create your es_ES file as a synchronized copy of the es_MX file. Then modify any translations that need to differ.
This guide shows how to use the copy function: https://localise.biz/wordpress/plugin/custom-translations
See also this section on working with alternative templates: https://localise.biz/wordpress/plugin/manual/templates#copy
Hello!
I got it to work. Here’s the thing and I want to explain the solution because I found many other people had the same issue.
Problem: as today 1/May/2025 the string doesn’t exist in Spanish (Spain), and some other languages. The string is found inside the “WooCommerce” plugin.
Solution: Click on Loco->Plugins (as the string lives in a plugin)-> WooCommerce->”EDIT TEMPLATE” (if you’ve already created one)-> “ADD” (as we need to add the string)-> Type in the string exactly and don’t translate it yet. We’re just adding it.
After the string is added, save it and go back to the language list. This time instead of “editing the template” click on the language, or “edit” below the language. The string must have been added by now and you can now translate it accordingly.
I hope I was clear.
Plugin Author
Tim W
(@timwhitlock)
Manual editing of author-provided templates is not recommended, but if that works for you in this specific case, then great.
Be aware that if you edit the shipped woocommerce.pot
file, your changes will be LOST when WooCommerce is updated.
Other, apparently similar issues may be completely different and require a different solution.
In your case, I note that the string “If you have a coupon code, please apply it below” is not contained in the current version of WooCommerce. Possibly it was removed at some point, and is still relied upon by dependent plugins or themes.
Oh thank you for this piece of information. Then it’s not a solution, it’s like a patch. What can I do if the string is not contained originally in the woocommerce.pot
file?
Plugin Author
Tim W
(@timwhitlock)
Firstly establish what is actually using this string. If you have the latest version of WooCommerce, then it isn’t WooCommerce, because this string is not in their code. Hence why it isn’t in their POT file.
If some other component is trying to use a string in the woocommerce
text domain that doesn’t exist (or perhaps used to exist), then the developers of that component should be informed. This would qualify as an incompatibility with the latest version of WooCommerce. Their course of action is up to them, but really they should define their own strings in their own text domain.
You may find out that the string is actually from another text domain. In which case you should find the string where it resides instead. However, as your hack works, then it proves the string is being requested from the woocommerce
text domain. At least it is in the instance you are testing.
As this issue appears external to the functioning of my plugin, I’m marking this issue as resolved. I’ve provided my recommendation for ensuring your ES region is synced to your MX region. This is as far as I can go, unless you have further questions about how Loco Translate works?