Skip Navigation

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

Problem:
The client is unable to locate and translate the text above the search box in the Kadence modal search box on their website.

Solution:

We advised the client that the text they are trying to translate is added through the theme's functions.php file and is not set up for translation by default.
To make this text translatable, they should replace the existing function in

functions.php

with the following code:

function kt_add_form_title( $form ) {
    $content = '<div class="search-modal-content"><h5>' . __('What are you looking for?', 'your-text-domain') . '</h5></div>';
   return $content . $form;
}

After updating the function, they should navigate to WPML->Themes and Plugin Localization to scan the theme and then translate the text using WPML's String Translation. For more details on theme internationalization, visit WordPress Theme Internationalization.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket.

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 5 replies, has 2 voices.

Last updated by emmanuelleD-4 2 weeks, 6 days ago.

Assisted by: Shekhar Bhandari.

Author Posts
December 9, 2024 at 2:37 am #16490780

emmanuelleD-4

Background of the issue:
I am trying to locate the text above my search box in my Kadence modal search box on my site hidden link. I have tried enabling 'Look for strings while pages are rendered' and checking 'Can't find the strings you're looking to translate?' but I cannot find the text.

Symptoms:
Search modal box text is not translating.

Questions:
Could you guide me on how to locate and translate the text above my search box?

December 9, 2024 at 4:24 am #16490880

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you on this issue.

Are you taking about this text? "what are you looking for?"

Can you let me know how the text is added on the modal box, is it plugin settings?

Can you follow the below steps and see if it helps:
- Go to WPML->String Translations
- At the bottom of the String Translation table, click on “Translate text in admin screens”
- Search for the strings there and see if you can find them.
- If you can find it, select it and add it using the “Add to string translation” button
- Click on “Return to String Translations”
- Translate it

Look forward to your reply.

Thanks

December 9, 2024 at 12:25 pm #16492683

emmanuelleD-4

Hi Shekhar,

I followed your instructions but still can't find it there. I am indeed referring to "what are you looking for?". It was added through the functions.php since this is the Search Kadence form.

Kind regards,

Emma

December 9, 2024 at 12:27 pm #16492702

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

To debug this issue further, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.

So could you please provide me with those details, you will find the needed fields for this below the comment area when you log in to leave your next reply.
hidden link

This info is private and available to you and WPML supporters only.
Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note:
Backup your sites before providing the credentials or if possible provide credentials for the test site

Look forward to your reply.

Thanks

December 9, 2024 at 2:08 pm #16493531

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The content is added from theme functions.php and is not translatable. hidden link

function kt_add_form_title( $form ) {
	$content = '<div class="search-modal-content"><h5>what are you looking for?</h5></div>';
	return $content . $form;
}

You can replace it with the following code

function kt_add_form_title( $form ) {
	$content = '<div class="search-modal-content"><h5>' . __('What are you looking for?', 'your-text-domain') . '</h5></div>';
	return $content . $form;
}

Then go to WPML->Themes and Plugin Localization and scan the themes and translate it from string translations.

More details: https://developer.wordpress.org/themes/functionality/internationalization/

Let me know if this helps.

Thanks

December 9, 2024 at 2:23 pm #16493666

emmanuelleD-4

Thanks so much Shekhar, it does work now! 🙂
I'll delete the private message with my login details just in case, as I see a delete button.

Have a great day,

Emma