Home Forums WoodMart support forum Can’t translate a string

Can’t translate a string

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #610579

    dweb360
    Participant

    Hello
    Can’t translate the “Out of stock” for a variable product! Even using functions.php

    
    function custom_text_replace( $translated_text, $untranslated_text, $domain ) {
        switch ( $untranslated_text ) {
            case 'Rupture de stock':
                $translated_text = __( 'Bientôt disponible', $domain );
                break;
            // Leave the default case out when using languages other than en_US
            default:
                $translated_text = $untranslated_text;
                break;
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'custom_text_replace', 20, 3 );
    

    Thank you

    • This topic was modified 18 hours, 51 minutes ago by dweb360.
    #610661

    Luke Nielsen
    Keymaster

    Hello,

    I suggest you use the Loco Translate plugin:

    https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    Let me know the result.

    Kind Regards

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