• Resolved Asklepios

    (@mischi98)


    In the search function of the mobile version, these words appear: “Go to…” I would now like to translate these. I have been trying for three days and it has failed. Neither Loco Translate has been able to translate this nor can I find anything about it online. Who can help me?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The text you are referring to might not be coming from a plugin or your theme. It could be dynamically generated or hardcoded somewhere within your theme files or a plugin.

    Since Loco Translate doesn’t find it, I suggest using your browser’s developer tools (right-click > Inspect) to locate the source of the “Go to” text.

    Hi @mischi98

    The issue could be this text is added as a placeholder for the search field, and that’s why Loco Translate can’t find it. Placeholder text is often hardcoded in the HTML or JavaScript and not part of the translatable strings registered with WordPress.

    You can use a plugin like String locator to find where the text is from. That always does the trick.

    Hi?@mischi98

    To translate the “Go to…” text:

    1. Use Loco Translate: Ensure you’re translating the correct text domain. Check if it’s under a different domain or use the “Say What?” plugin to change it.
    2. Check Theme/Plugin Files: Look in the .php files related to search functionality for the string.
    3. Use functions.php: Add a filter to replace the text if it’s custom:phpCopy code add_filter( 'gettext', 'my_custom_translate', 20, 3 ); function my_custom_translate( $translated_text, $text, $domain ) { if ( 'Go to...' === $text ) { $translated_text = 'Your translation'; } return $translated_text; }
    4. Plugin Conflict: Disable plugins that affect search/navigation to isolate the cause.

    Hope this helps.

    • This reply was modified 2 months, 1 week ago by Kausar Alam.
    Thread Starter Asklepios

    (@mischi98)

    Thanks, I will download String Locator ??

    Thread Starter Asklepios

    (@mischi98)

    Thanks You Lina as well ??

    Thread Starter Asklepios

    (@mischi98)

    Dear @kausaralm thank you very much for your description and help.

    You are welcome @mischi98

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.