This thread is resolved. Here is a description of the problem and solution.
Problem: The client reported that a quiz feature on their staging site was working in Hebrew, English, Arabic, and Russian, but not in French and Spanish. They identified that special characters in translated strings were causing the issue and temporarily removed the translation.
Solution: We advised the client that supporting custom code falls outside our support scope, but we provided guidance to help resolve the issue. We recommended using gettext calls to make strings added with custom code translatable and provided documentation links:
$my_current_lang = apply_filters( 'wpml_current_language', NULL );<br /><br />if($my_current_lang=='fr'){<br />//Custom code for French quiz<br />}
If these solutions are not helpful, we recommended trying one of the WPML-compatible plugins listed here: WPML-compatible plugins. Alternatively, the client can seek assistance from a third-party contractor or developer, with a list of certified contractors available here: WPML-certified contractors.
If this solution doesn't look relevant, please open a new support ticket at WPML support forum.
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.
click submnit quiz and you can se that it work in hebre, english, arabic, russin.
in FR and ES it dosnt work, I think that something is not set corrctlly in my site
please check it, this is staging site so you can change and check as you wish, i have backups
First of all, sorry for the late reply due to a higher workload on the weekend.
1. Please increase the WordPress Memory Limit. According to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. Minimum requirements for WPML is 128Mb. (Kindly check this page https://wpml.org/home/minimum-requirements/)
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:
2. Please also tell me more details about which plugin you use to create the quiz and how it's translated.
3. The French page shows a critical error message (Please see the attached screenshot). Please provide me with the WordPress debug.log, so we can check what PHP errors are being produced. More Info: https://wordpress.org/support/article/debugging-in-wordpress/
To enable it, open your wp-config.php file and look for:
define('WP_DEBUG', false);
And change it to:
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings which is recommended on a live site.
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
Then visit the French page and check if any errors were saved to the debug.log file inside the /wp-content/ directory.
If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!
Hi
1. thank for answerin me
2. maybe you checked the site in spesific moment that i did some error, please check now hidden link
you will see the quiz and not the error
3. i dont use quiz plugin, it is custom code
3. it work good in other languagesm you can see, just Spanish and French dosnt work
the debug.log is empty
bu in console i see: Uncaught SyntaxError: Unexpected identifier 'Amélioration' (at baladiyeh-municipal-hospital/:910:31)
it is only in the problematic languages
I find the problem, some translates string looked like this: Amélioration and the special charachters did the problem
can you sudgest me how to solve it?
now i just remove the translation
I'm glad to hear that you were able to find the problem, but I'm afraid that supporting custom code is out of our support scope. Kindly check our support policy (https://wpml.org/purchase/support-policy/)
However, I will try to point you in the right direction. To make the strings added with custom code translatable, you should use gettext calls. Please check the following docs for more info:
Another method is trying with the "wpml_current_language" hook to add a different quiz for each language. For example:
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if($my_current_lang=='fr'){
//Custom code for French quiz
}
If that didn't help, I suggest trying one of the compatible plugins. Please check the list here: https://wpml.org/plugin/
You can also contact a third-party contractor or developer to fix the code. Please check
the list of certified contractors here: https://wpml.org/contractors/