Home›Support›English Support›[Resolved] When using the blocks checkout some strings are not correctly loaded
[Resolved] When using the blocks checkout some strings are not correctly loaded
This thread is resolved. Here is a description of the problem and solution.
Problem:
When using the blocks checkout, some strings are not correctly loaded in the current language.
Solution:
If you're experiencing this issue, we recommend that you first perform a full site backup. After ensuring your data is secure, upgrade to the latest versions of WordPress, WooCommerce, and WPML plugins. These updates include fixes that might resolve the language loading issue in the blocks checkout.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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.
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.
Sorry for the very late response. Please upgrade to the latest version of WordPress, WooCommerce, and WPML plugins after a full site backup {mandatory}. Then make sure the bug exists or not. Because the latest versions include the fix for this.