[Resolved] .mo Polish translation file for WooCommerce isn't working.
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was trying to enable the Polish translation for WooCommerce by following a guide and uploading the .mo file to the
/languages/woocommerce
directory, but the strings remained in English. Solution: We found that the translation should load automatically from WooCommerce. However, there is a known issue where translations do not load when using the block cart and block checkout if
WP_PLUGIN_DIR
and
WP_PLUGIN_URL
are defined in
wp-config.php
. To work around this problem, we recommend: 1. Using the
[woocommerce_cart]
shortcode on the cart page instead of blocks. 2. Removing the
WP_PLUGIN_DIR
and
WP_PLUGIN_URL
definitions from
wp-config.php
and using the standard plugins folder.
Please note that this solution might be outdated or not applicable to your case. If the issue persists, 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 you still need assistance, 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.
I am following this guide: hidden link I downloaded the .mo Polish translation file according to the instructions and I put it in the /languages/woocommerce folder. How can I enable this .mo file to have woocommerce translated in Polish?
The guide says "6/ Upload to your site under wp-content/languages/woocommerce/. Once uploaded, this translation file may be used."
I did it... but strings are still in English.
can you please share the steps or URL where I can see the strings not translated?
I checked for example cart page and can see these strings are coming from the page builder nad need to be translated when translating the page. Also, it could be some of the strings are coming from your theme WC templates not WC plugin.
I checked further and downloaded the PO file instead MO file as instructed in the shared guide. I have then gone to WPML String translation and imported translation there (option to import at bottom of page).
Strings are now imported and translated but still not showing correctly on the frontend, before checking further please let me know if it is okay for me to disable all other plugins and switch themes on the shared website or if you can provide a staging site where we can check further.
yes, you can disable temporarily the plugins (it was already done via chat).
But please do not leave them off more than 15-20 minutes.
Please note to turn back on the same plugins.
The plugin that have to stay off are:
Cherry Plugin (the older one)
Enable jQuery Migrate Helper
Google Listings and Ads
Instant Images
Jetpack
Merge + Minify + Refresh
Pinterest
Regenerate Thumbnails
Wordfence Security
WP Realiable Cookie Bar
WP STAGING WordPress Backup Plugin - Backup Duplicator & Migration
WP Super Cache
The rest needs to be ON as soon as possible, because the frontend will change when the plugins are off and can damage the rankings. The page is visited by google bots very often.
If 15-20 minutes is too short for troubleshooting, please feel free to create a staging environment.
thanks, 2nd tier found the problem and I am sharing a summary:
- Translation should load from WC automatically.
- Due to a bug in WC or WP when WP_PLUGIN_DIR and WP_PLUGIN_URL is defined translation is not loaded only when using block cart and block checkout. We will report it.
- For a workaround, either use the [woocommerce_cart] shortcode in the cart page instead of blocks or remove the WP_PLUGIN_DIR and WP_PLUGIN_URL from wp-config.php and use the standard plugins folder for plugins.
Hi, today I noticed that something got broken during one of your test. Probably during the initial chat with WPML support.
1) I just published an article in PL language. This is the link of the blog loop: hidden link
I see many texts that were translated before, are not translated anymore. For example "Articles" in the top. "Pages" in the sidebar", the "newsletter" box in the footer, the "Read more" buttons. They were in Polish until few days ago. Now they are in English.
2) I tried to see and enter into page edit mode hidden link but I get a popup "Warning: You are trying to edit a translation using the standard WordPress editor but your site is configured to use the WPML Translation Editor.". I never did that before. I have always used normal "wp" pages for translation. Not automatic ways or translator editor. I didn't click any buttons here to avoid further problems, but I see the page title is in PL language... so why it is showing in English? Can you please fix what was changed in the last few days?
New threads created by Dražen and linked to this one are listed below: