• Resolved lydia17

    (@lydia17)


    With this code in fonction.php

    /**
    * A local translation snippet. Change ‘YOUR TEXT HERE’ to your desired text.
    * @param $translations
    * @param $text
    * @param $domain
    * @return string
    */
    function my_give_text_switcher( $translations, $text, $domain ) {

    // changes the “Donations” text in multiple places
    if ( $domain == ‘give’ && $text == ‘Donations’ ) {
    return __( ‘Promesse de Don’, ‘give’ );
    }
    if ( $domain == ‘give’ && $text == ‘Payment Pending: Please follow the instructions below to complete your donation.’ ) {
    $translations = __( ‘En attente : Merci de suivre les instructions pour finaliser votre promesse de Don’, ‘give’ );
    }
    return $translations;
    }
    add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );

    The first works fine, but the second (Payment Pending: Please follow the instructions below to complete your donation) does not works
    Thanks for your help

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘The php code for the translation does not work’ is closed to new replies.