fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

text translatio for product archive

Tahir Hassan

https://paste.pics/LHFXG after selecting the text is showing in english how can i translate this text

Rezwan Shiblu

Hi there,

Thanks for reaching out to us.

You can try to use the below code in your theme functions.php file for translating any text –

/**
 * Code goes in theme functions.php
 *
 * My quick custom translations or text changes.
 */
add_filter( 'gettext', function ( $strings ) {
    /**
     * Holding translations/changes.
     * 'to translate' => 'the translation or rewording'
     */
    $text = array(
        'Add to cart' => 'type yur desired text here',
    );
    $strings = str_ireplace( array_keys( $text ), $text, $strings );
    return $strings;
}, 20 );

Thank you.