Home›Support›English Support›[Escalated to WPML Developers team] When using the blocks checkout some strings are not correctly loaded
[Escalated to WPML Developers team] When using the blocks checkout some strings are not correctly loaded
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
As asked by support, I've installed a very simple example on the sandbox provided by you.
If you checkout in Portuguese you'll see that some strings are translated and others are not, but all of them are in fact loaded correctly if you disable WPML and set the website to Portuguese.
Just add a product to the cart and go to hidden link
Details of the problem:
- All strings that are part of the blocks and come from Javascript/JSON files are correctly loaded in Portuguese (for example: "Morada de facturação" hidden link )
- The strings that are incorrectly loaded in English are the one that the block reads from PHP, for example, all strings here: hidden link (for example "First name" hidden link )
- If WPML is disabled and the website is set to Portuguese, all strings are correctly loaded from PO and JSON files. It should be the same with WPML.
- It should NOT be necessary to scan the plugin into the WPML strings database. It should load correctly from the translation files loaded from wordpress.org automatically. This needs to be fixed to work from the PO/JSON files, not being necessary to fill the database with almost 9000 strings. (I did tried it and the result is exactly the same)
- I suspect this his related by the fact these blocks are loaded via the REST API and maybe WPML is not "short circuiting" correctly in that situation to "tell" WordPress he is running in Portuguese and not English on that specific call.