Change text using Child functions.php

  • zaqwsxcderfv2

    #6199

    Hi all,

    I want to change some output text on my website, using code like the ‘function graphene_filter_gettext’ code found on this forum:

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Category Archive: <span>%s</span>' => '<span>%s</span>',
    '%1$s Archive: %2$s' => '%2$s',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    I use this to get rid of the “Category Archive:” and this works fine.

    But, I also have some code displaying the day of the week. Say “Monday”. But I want to change this to the Dutch equivalent “Maandag”. I thought this would do the trick:

    'Monday' => 'maandag'

    And add it to the code above. But that is not working. Does anybody know a general code to use in the Child functions.php to change one word to the other?

    Thanks.

    ps. the .MO file is already correct translated. So I do not think that will solve this.

    Prasanna SP

    #33654

    Put code in between backtick (

    Code:
    `

    ) characters. It’s usually located above the Tab key on your keyboard.

    zaqwsxcderfv2

    #33655

    Hi Prasanna,

    I used the ‘ on my Mac, but that did not do the job. Next time I try to use the `. Thank you for making my post more clear.

    Zack

    Prasanna SP

    #33656

    You can also select the whole code and press code button in the editor.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.