I can’t tell why it didn’t work. The string has to be exactly right. The cache in WooCommerce, or transients, are for products. You can clear transients in Settings > System Status > Tools tab, but I don’t think these transients store strings.
However, your edited translation file will be overwritten by updates, or if you save your updated translation file in the custom location, it will not be updated for you automatically in future.
Instead you can use:
https://en-gb.wordpress.org/plugins/say-what/
When setting up a string in Say What?, the string to be translated is the exact string you get when US English is set. The domain is woocommerce, and the context is blank.
Hello, thanks for the answer.
I try using the plugin “Say What?” but it seems that it doesn’t work for me (or I set it wrong). In the end I found the string in the plugin code, I didn’t find it at the beginning because it was in another language, and I changed it to my translation (in /templates/checkout/payment.php). I don’t know if this change will affect if in the future I want to add one or more languages to the web.
I give the question as resolved, thank you!
If you changed payment.php in the core plugin it will be overwritten by the next update.
You can copy payment.php to:
wp-content/themes/my-child-theme-name/woocommerce/checkout/payment.php
and edit the copy. However, you will need to update the copy every so often when Woo next updates that template.
The string to be translated is the exact string from payment.php. This will be the string you get if you temporarily change your site language to US English.