Home›Support›English Support›[Resolved] We have troubles with a po/mo file from apl that isn't used for translations
[Resolved] We have troubles with a po/mo file from apl that isn't used for translations
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to import a PO file for the English language because the English option was not appearing in the dropdown list during the import process in WPML. Additionally, even after importing, the translated strings were not reflecting on the frontend. Solution: To address the dropdown issue, we recommended modifying the WPML String Translation plugin code. Specifically, the client should edit the file at
and make the following changes: 1. Around line 671, replace the existing code with:
foreach ($active_languages as $al) : ?>
2. Repeat the modification around line 746. It's crucial to back up the database and website before making these changes. For the issue of translations not appearing on the frontend, it was identified as a custom plugin text domain loading issue. The solution was to add the text domain "wc-wintree" in WPML under Theme and plugins localization > Localization options > Automatically load the theme's .mo file using 'load_textdomain'.
If these solutions do not resolve your issue or seem outdated, please check the related known issues and ensure you have the latest versions of themes and plugins installed. If the problem persists, we highly recommend opening a new support ticket here.
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.
We were able to import the english string translations and now see that multiple strings are indeed translated. However when we go to the front end and then switch to the english language nothing changes like we didn't switch at all while in the backend it show that it is translated. And yes the string i am talking about strings that encoded like this : are __('string', 'translation-domain')
Do you have any idea what is going wrong? I added 2 images. "translated-string.PNG" shows that the string is translated in backend and "front-end-not-translated.PNG" shows that in the english language in the frontend the string is not getting translated. Could you tell me what is going wrong?
After updating the plugin WPML String Translation to the new version 3.2.10, the translation strings are displayed in the frontend as well. Please check the attached screenshot.
However, it doesn't work with the latest version 3.2.11. I'm not sure what's wrong with your custom plugin.
I made a test by adding the code below to the file functions.php in the custom plugin and a standard theme of WordPress (2021). Only the translation string in the theme is displayed.
I suggest you get in touch with your developer and check the issue with the custom plugin. If you are not able to accomplish this, I would recommend you contact one of our certified partners who will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/
I am the developer of that plugin and i checked the plugin and cannot find anything why it wouldn't be translated in the newest version of the plugin. I also cannot see anything within the update 3.2.11 that would cause this?
I'm not sure what the root issue is on your site but I tried to replicate the issue on a clean installation of WordPress, install only your plugin and didn't see that. If you want to take a look, please click on this link hidden link
Also, after restoring your site on my localhost, I find a workaround to fix the issue with your instance when using WPML String Translation 3.2.11.
1. Go to WPML > Languages > Change the default language to English.
2. Go to WPML > Theme and plugins localization > Scan strings in the custom plugin wc-wintree.
3. Go to WPML > String Translation > Import the PO file.
4. Check the translation strings in the frontend, if it works properly, you can change the default language back to Dutch.
I updated the string-translation plugin and did the 4 steps you said i could do to fix it but sadly it did not fix the problem. I made a backup of the older version of string translation so can put back if needed.
In the backend the strings are shown as dutch strings and it shows that it has an English translation as it has a pencil for the English language.
It looks like a specific issue on your site only. I'm discussing this with our 2nd tier support and I will update you here when I have something to share.
I got some information from our 2nd tier support. It could be a custom plugin text domain loading issue. The issue has been solved by adding the text domain "wc-wintree" to WPML > Theme and plugins localization > Localization options > Automatically load the theme's .mo file using 'load_textdomain'.
royE-2 confirmed that the issue was resolved on 2024-05-14 10:08:31.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.