Support » Theme: Blocksy » Search Results title and subtitle in French

  • Resolved pouicpouic

    (@pouicpouic)


    Hello,
    thanks for this great theme!
    It’s very clean and extensive, really fun to work with.

    I am building a site in french and have a small problem with the Search tool.
    The Search placeholder displays Rechercher correctly in French.

    However, the Search Results messages are displayed in English.
    The span.page-title displays:
    ‘Search results for’…
    And when there are no results found, the subtitle .page-description displays this message:
    ‘Sorry, but nothing matched your search terms. Please try again with some different keywords.’

    The only file where I could locate these message is the \blocksy\inc\components\hero\elements.php file.

    else {
                    $title = sprintf(
                        // translators: %s is the number of results
                        __( '<span>Search results for</span> %s', 'blocksy' ),
                        get_search_query()
                    );
    
                    if (! have_posts()) {
                        // translators: %s are the opening and closing of the html tags
                        $description = sprintf(
                            __('%sSorry, but nothing matched your search terms. Please try again with some different keywords.%s', 'blocksy'),
                            '<div class="' . $description_class . '">',
                            '</div>'
                        );
                    }

    When I edit this file, the page-title and subtitle are displayed correctly in French, but I have not been able to make it work from a file located in the child theme.
    How can the Search Results page-title and subtitle be edited without modifying files in the Blocksy theme folder?

    Thank you in advance for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @pouicpouic

    You can use Loco Translate — https://wordpress.org/plugins/loco-translate/ — to translate any string on the webpage. We’ve built in support for Loco Translate throughout Blocksy and its companion plugin and it should work seamlessly.

    Once installed, you’ll need to go into the plugin and synchronise the translation template files.

    Let me know how it goes.

    Thanks.

    Thread Starter pouicpouic

    (@pouicpouic)

    Hello Eduard, thank you for your answer.
    I prefer to avoid adding another plugin just to edit two sentences on the whole site, and I would like to be able to edit the English text as well.
    Can I do this without using a plugin?

    Theme Author creativethemeshq

    (@creativethemeshq)

    Hello @pouicpouic,
    You can install the Loco translate plugin, translate all strings you need and after this remove the plugin 🙂

    Hope this helps.

    Thread Starter pouicpouic

    (@pouicpouic)

    Hello,
    the translation exists already but is not showing up on the search results page, unfortunately Loco Translate doesn’t help.

    Thread Starter pouicpouic

    (@pouicpouic)

    The translation is working since it has been validated today on https://translate.wordpress.org.
    I still wonder how to edit the original English text for Search Results?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search Results title and subtitle in French’ is closed to new replies.