• Karin Leloux

    (@karin-leloux)


    Hi
    I want to translate “posted on ” to dutch..
    I use the zerif pro theme; how can i change this in the php file?

    Regards
    Karin Leloux

Viewing 3 replies - 1 through 3 (of 3 total)
  • Madhusudan Pokharel

    (@madhusudan977)

    Hello Karin,
    To change ‘posted on’ to say ‘dutch’, just add the below codes in ‘functions.php’ of child theme.

    add_filter( 'gettext', 'theme_change_postedon_field_names', 20, 3 );
    function theme_change_postedon_field_names( $translated_text, $text, $domain ) {
        if ( is_singular() ) {
            switch ( $translated_text ) {
                case 'posted on' :
    
                    $translated_text = __( 'dutch', 'zerif-pro' );
                   break;
            }
        }
        return $translated_text;
    }

    Note: This function translates all the matching text to the translating text allover the theme.
    Also,It is recommended to create child theme if you are going for the coding option else your changes won’t be saved when you update the theme. For that: https://codex.www.ads-software.com/Child_Themes#How_to_Create_a_Child_Theme

    Let me know how it goes!!

    Thread Starter Karin Leloux

    (@karin-leloux)

    Hi
    Thanks for your support but it does not work unfortunately..
    Is there a special area where i have to put the code??

    Regards
    Karin
    Btw: i want to translate the words “posted on” in:
    “geplaatst”op”…that is dutch for posted on…
    Hope you can help me…

    Madhusudan Pokharel

    (@madhusudan977)

    Hello Karin,
    It’s seems you are having creating child theme manually,right?
    You can create the child theme using this plugins:https://www.ads-software.com/plugins/one-click-child-theme/
    After activating the child theme, go to Appearance-> Editor -> functions.php paste the following code in the bottom empty area.

    add_filter( 'gettext', 'theme_change_postedon_field_names', 20, 3 );
    function theme_change_postedon_field_names( $translated_text, $text, $domain ) {
        if ( is_singular() ) {
            switch ( $translated_text ) {
                case 'posted on' :
    
                    $translated_text = __( 'geplaatst op', 'zerif-pro' );
                   break;
            }
        }
        return $translated_text;
    }

    After pasting the code click Update File.
    Let me know how it goes!!

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