Hi @ispacecrusader ,
Apologies for the late reply here. I ran this by our team, and they wanted to confirm that WPML cannot normally translate strings for the native site language. Can you confirm if the issue is related to the site native language or for a different language?
Please note too that this module allows you to define the text for the native language in the module settings under Uncanny Toolkit > Modules, like this: https://cln.sh/Y5HJr7Pc. Have you tried changing the text there?
Thread Starter
Boris
(@ispacecrusader)
Hi,
thanks for your help!
the default language for the site is English, and the text I entered on the Resume Button is also in English. The issue is with the translation to Spanish.
I tested whether changing the language setting (flag at black top bar in WP-admin) to Spanish and then entering text worked. But then it’s also Spanish on the English part of the site.
I also managed to add the value as a string (via translate texts in admin screens in WPML / Strings) so it shows up in the strings like this:
Domain: admin_texts_LearnDashResume
Name: [LearnDashResume][0]value
String: Resume Course
and I translated that. But that translation does not show up anywhere in WP-admin or on the front end.
Thread Starter
Boris
(@ispacecrusader)
Hi, sorry for bumping, but have you had a chance to look at the issue I reported? Thanks very much!
Apologies for the very long delay here.
Our dev team says you should remove the custom text added to the Resume button settings page and then add the following filter to the functions.php file of your child theme:
function custom_learndash_resume_link_text( $resume_link_text ) {
// Check the current language
$current_language = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : 'en';
// Set text based on the language
if ( $current_language == 'es' ) {
return 'Reanudar Curso'; // Spanish text
} else {
return 'Resume Course'; // English text (default)
}
}
add_filter( 'learndash_resume_link_text', 'custom_learndash_resume_link_text' );
Replace the text “Resume Course” above with the text you had been using in the module settings and replace “Reanudar Curso” with your Spanish text.
Hopefully that helps.