-
Notifications
You must be signed in to change notification settings - Fork 220
The translation of block.json
text doesn't fallback to WooCommerce's translations
#8639
Comments
I updated the title and description highlighting some findings! |
block.json
text doesn't fallback to WooCommerce's translations
Hi @tarhi-saad I thank you for your reply. I noticed that the problem also occurs with inner blocks such as "Subtotal" of "Cart": The problem seems similar to that addressed in these PRs: #8591 and #6737 There are i18n problems with the Thanks. |
Hello @DAnn2012 👋
That's correct. Every element, that gets the title and description purely from the If you head over to https://translate.wordpress.org/locale/it/default/wp-plugins/woo-gutenberg-products-block/, you'll find the Italian translations there. Above the table, that shows the translation status, the following message can be found:
I also see that most strings have been translated, but haven't been approved yet. I'll reach out to my Italian-speaking colleagues to clarify if one of them can review and approve the waiting translations, so that the Italian language pack can be generated. |
Hello @nielslange I thank you for your reply. Unfortunately, I am familiar with how late strings are approved on translate.wordpress.org. I was the one who submitted for approval I would like to ask you something. But when the language package of WooCommerce Blocks for Italian language is generated, will it be automatically loaded and installed by WordPress even if my version of WooCommerce Blocks is the one included in WooCommerce? Thanks. (*) The number changed after today's release of version 9.8.0 |
Hello @DAnn2012,
I reached out to a few colleagues internally asking them if they could request PTE (Project Translation Editor) rights to be able to approve the waiting strings. I hope that they will be approved soon.
Once the Italian language pack is generated, you might see an update prompt within the WordPress admin dashboard: |
Hello @nielslange I noticed that in the the Could this be the problem? That is, when WooCommerce Blocks is included in WooCommerce the value of Thank you. |
Hello @DAnn2012,
That's a great finding! Earlier today, I created Replace woocommerce-blocks textdomain in *.json files for the WooCommerce repo. I'll reach out to the folks and ask them to consider this change for the WooCommerce 7.6.0 release. Meanwhile, you could search and replace Thanks again for pointing this out! Your comment helped a lot. 🙏 |
Hello @nielslange I am very glad to have been helpful. I just wanted to point out that in your screenshot that you posted in the PR the "Customer account" item is still in English. How come?
Thanks. |
Hello @DAnn2012,
When comparing the WooCommerce Blocks translations with the WooCommerce translations, I noticed that the string However, it seems that as soon as the Italian language file for WooCommerce Blocks can be generated, the string As for the Italian translation pack, my colleague requested permissions to be able to approve the waiting Italian translations. I hope that he'll find the time to approve the waiting strings within the next week. |
Hello @nielslange However, if you notice, for WooCommerce Blocks the first string refers to the while the second string refers to two While for WooCommerce the only string is for the two and it is also translated differently, the ones in your screenshot therefore seem to be from the WooCommerce Blocks translation and not the WooCommerce one. In fact, only the WooCommerce Blocks customer-account.js file has, towards the end, this:
concerning the registerBlockVariation, while this is not there in WooCommerce's customer-account.js file. The strange thing is that to me, who changed only the textdomain reference from "woo-gutenberg-products-block" to "wordpress" in the I also checked in my |
Hallo @DAnn2012, I agree with your points and noticed the same. At this stage, unfortunately I do not have an answer what happened in this particular case. |
@nielslange the core .json change was merged; can this issue be closed now? |
@mikejolley, @nielslange! Is the translation fallback also supposed to work when using the Woo Blocks plugin? For now, this PR fixes the translation bug only when using Woo Blocks in core! |
@mikejolley Initially, I thought about keeping this issue open until woocommerce/woocommerce#37234 had been shipped. However, I noticed that the change will be shipped with WooCommerce 7.7. Thus, it might not be available before the end of May. Therefore, I think it's safe to close this issue.
@tarhi-saad While we are using a fallback mechanism for loading translations in JS and PHP files, for loading translations in JSON files, we don't have a fallback mechanism yet. My PR wasn't aiming at creating a fallback mechanism, but to ensure that the textdomain within JSON files will be changed from Back to your questions, when using both WooCommerce and WooCommerce Blocks, WooCommerce contains a translation of the JSON file, but WooCommerce Blocks does not contain a file, then the English string will be displayed. It is worth noting that the screenshot in the upper-left corner still shows |
Describe the bug
Title and description of some blocks does not display translated.
It concerns the following blocks:
Some findings
After a thorough investigation by @nielslange (see p1678281263182499-slack-C02UBB1EPEF), we believe that the translation of the text from block.json files sent to the back-end doesn't fallback to WooCommerce translations. In this particular case, the Italian translations of the text and description of our Blocks can be found in /wp-content/languages/plugins/woocommerce-it_IT.po, while the Woo Blocks file is missing (i.e., app/public/wp-content/languages/plugins/woo-gutenberg-products-block-it_IT.po).
Screenshots
Environment
WordPress (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: