• Resolved supremissimo84

    (@supremissimo84)


    Hi all,

    I’m new with this theme and with WP community; I like the theme and I need to translate some words in Italian (i.e. LEAVE A REPLY, POST A COMMENT).

    I visited the translation project page; the question is: I need to manually translate all the single words, acting on php files or there is a way to do it faster?

    Thanks in advance.
    Vincenzo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi supremissimo84. If you only want to translate a few items you could use this function in a child theme functions.php file:

    /* ------ Change selected text ------ */
    add_filter( 'gettext', 'my_new_text', 20, 3 );
    function my_new_text( $translated_text, $text, $domain ) {
        switch ( $translated_text ) {
            case 'Leave a Reply' :
                $translated_text = __( 'Reply Here', 'hueman' );
                break;
            case 'Post a Comment' :
                $translated_text = __( 'Comment Here', 'hueman' );
                break;
            case 'You may also like...' :
                $translated_text = __( 'More posts like this...', 'hueman' );
                break;
            case 'To search type and hit enter' :
                $translated_text = __( 'This is the Search Box', 'hueman' );
                break;
        }
        return $translated_text;
    }

    You can’t necessarily go by the text you see on the web page as some of it is converted to upper case.

    Thread Starter supremissimo84

    (@supremissimo84)

    Solved!
    thanks

    You’re welcome. Glad I could help. If you don’t need any further assistance with this topic please mark it as Resolved. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Support for translation’ is closed to new replies.