Home›Support›English Support›[Resolved] Look for strings while pages are rendered - Strings only show when this option is enabled
[Resolved] Look for strings while pages are rendered - Strings only show when this option is enabled
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.
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.
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,
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/