Skip to content Skip to sidebar

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

Problem:
If you're experiencing issues with strings from a plugin showing up translated only when you enable the 'Look for strings while pages are rendered' option in WPML, it might be due to a database character set configuration.
Solution:
We recommend checking your

wp-config.php

file for the

DB_CHARSET

definition. If it's set to

utf8

, you should change it to

utf8mb4

to support a wider range of characters, including symbols and special characters. This change can resolve issues with string translation due to character set mismatches.

Please note that this solution might not be relevant if it's outdated or not applicable to your case. If after trying this solution you still encounter issues, 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 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 7 replies, has 2 voices.

Last updated by Ilyes 1 year, 2 months ago.

Assisted by: Ilyes.

Author Posts
April 23, 2024 at 7:12 pm

dariusB-3

If I enable : Look for strings while pages are rendered

* This feature is only intended for sites that are in development. It will significantly slow down the site, but help you find strings that WPML cannot detect in the PHP code.

strings for the plugin show up translated

April 23, 2024 at 9:05 pm
April 25, 2024 at 1:04 am #15563004

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

After further investigation, it turns out to be an issue in the DB charset configured under your config.php

I have changed

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

to

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

The utf8mb4 character set is useful because nowadays we need support for storing not only language characters but also symbols and other special characters, UTF8 potentially caused this issue as there was a mismatch in charset, so I changed it,

Could you please check if that worked,

Best,

April 25, 2024 at 3:32 pm #15566598

dariusB-3

Wow thank you very much! This seems to be solved now after the changes. Thank you!!

April 27, 2024 at 2:18 pm #15572944

dariusB-3

Sorry problem is not fixed it appeared again EN version of these strings

Strings not translating

April 27, 2024 at 2:20 pm #15572975

dariusB-3

hidden link

check yourself

"Pickup location"
"Please select the pickup location"

So your solution does not work

April 29, 2024 at 11:26 pm
April 30, 2024 at 2:22 pm
April 30, 2024 at 10:43 pm #15582906

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

After various tries, I'm yet to find an explanation to this behavior,

That is why I had to escalate the matter to our 2nd tier and I will let you know if we got a solution,

Keep in mind that I installed two plugins that do not affect your front-end in order to debug the issue, I hope that's okay.

Best,

May 1, 2024 at 7:42 am #15583220

dariusB-3

Thank you very much!

May 2, 2024 at 12:15 pm #15587188

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

Thank you for your patience,

It seems this is coming from "MultiParcels Pristatymas WooCommerce" plugin. And possibility is this plugin is not loading the correct MO file.

So we checked the code of this plugin and found that it is not loading the domain in plugin constructor, which is not correct, because it is loading it before WPML is even loaded.

So I removed the

$this->load_plugin_textdomain(); 

from constructors and moved this to plugins_loaded hook up, now it seems to be working.

Please use a recommended plugin or contact the author to make these changes or suggest author to apply for go global program so we can assist author to make this plugin compatible:
https://wpml.org/documentation/support/go-global-program/

Best,

May 2, 2024 at 3:36 pm #15588297

dariusB-3

I am grateful to the moon and beyond! Thank you so much for caring and solving this! You are the best!