Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is trying to translate strings using the WPML plugin, but some strings, particularly in the French language, are not displaying their translations. These strings are from the WPL PRO plugin used on the client's website.

Solution:
We discovered a compatibility issue between the client's theme and WPML. Specifically, the problem lies within the

wpl_global::load_textdomain()

function of the Real Estate Listing plugin by Realtyna, which incorrectly unsets the MO file, leading to translations not being displayed. To resolve this, we recommend the following steps:

1. Ensure you make a backup of your website.
2. Edit the file

\wp-content\plugins\real-estate-listing-realtyna-wpl-pro\global.php

at line 2011.
3. Replace the existing

load_textdomain

method with the following code:

public static function load_textdomain($domain, $mofile)<br />{<br />    return load_textdomain($domain, $mofile);<br />}

After making these changes, check if the translations are now displaying correctly.

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 with us.

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.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Lucas Vidal de Andrade 11 months, 3 weeks ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
January 25, 2024 at 3:28 pm #15227079

drazenS

I'm trying to translate strings. I followed the instructions, and scanned for strings. Some strings are translated everywhere, but some of them are not, mostly for French language.

I use WPL PRO plugin, and strings that are not translated in every language are from that plugin.
To make it more clear, I can translate the strings but the translations are not showing.

Link to the web site: hidden link

January 25, 2024 at 7:24 pm #15227951

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for getting in touch with us. This issue is happening only for a specific language, is that right?

Can you share a screenshot of your String Translation screen that shows a problematic string on the list?

I'm waiting for your feedback.

January 26, 2024 at 2:35 pm #15230619

drazenS

Thank you for your quick reply.
String "Basic Details" is not translated only to French.(Images: 1,2,3) Other strings, and mostly custom ones are not translated to English, and French. (Images: 4,5,6)

4.png
5.png
6.png
3.png
2.png
1.png
January 26, 2024 at 3:07 pm #15231001

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT

- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:

hidden link

January 29, 2024 at 8:17 pm #15240629

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

After analyzing your issue locally, I wasn't able to get to a solution. So I escalated your ticket to our development team, which will look for a permanent solution. That usually takes a few days.

As soon as I have new information, I'll let you know. Have a lovely day, meanwhile 🙂

February 8, 2024 at 4:11 pm #15282172

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thanks for your patience. Our compatibility team has found a workaround for the issue. Kindly check the following steps:

1- Edit the (/wp-content/plugins/real-estate-listing-realtyna-wpl-pro/libraries/addon_pro.php) file
2- Check the following line: 937

if(!wpl_global::switch_language($w_active_language['default_locale'])) wpl_request::setVar('wpllang', $w_active_language['default_locale']);

3- Comment this line. To comment a line, you must add // at the beginning of the line. The commented out line should look like this:

// if(!wpl_global::switch_language($w_active_language['default_locale'])) wpl_request::setVar('wpllang', $w_active_language['default_locale']);

4- Clear the cache and check the front end;

❌ Please backup your site before performing the above steps ❌

Let me know if that solves your issue.

Best regards,
Lucas Vidal

February 8, 2024 at 5:06 pm #15282503

drazenS

Hello!

No, that didn't help... 🫤

Is there something else we can try?

February 9, 2024 at 10:54 am #15285197

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for sharing. We'll keep searching for a solution, and I'll keep you posted.

Best regards,
Lucas Vidal

February 19, 2024 at 12:56 pm #15318292

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

After deeply investigating your issue, we found out that there was a compatibility issue with your theme and WPML. The issue is that translations are only working with the Block theme and not with older themes like Twenty Twenty or Avada, due to a problem in the wpl_global::load_textdomain() function in the Real Estate Listing plugin by Realtyna. This function incorrectly unsets the MO file, preventing translations from being displayed. A proposed workaround is to modify the load_textdomain method in the plugin's global.php file to use WordPress's native load_textdomain() function instead of unsetting the MO file.

Please make a backup of your website and follow these steps:
1. Edit file \wp-content\plugins\real-estate-listing-realtyna-wpl-pro\global.php line 2011
2. Replace:

    public static function load_textdomain($domain, $mofile)
    {

with:

    public static function load_textdomain($domain, $mofile)
    {
        return load_textdomain($domain, $mofile);

And check again. Let me know how it goes.

February 22, 2024 at 2:20 pm #15334067

drazenS

Hi Lucas,

This is working, and the translations are now visible.

Thank you very much for your help.