Home Forums WoodMart support forum Can’t translate a string

Can’t translate a string

Viewing 8 posts - 1 through 8 (of 8 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 8 months, 1 week 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

    #611849

    dweb360
    Participant

    Hello
    I’m already using Loco Translate but can’t found the string “Out of stock” for a variable product.
    Thank you

    • This reply was modified 8 months ago by dweb360.
    #611866

    Luke Nielsen
    Keymaster

    Hello,

    I see that you have already translated it – https://prnt.sc/7-PlMyEQS3RA

    Clarify the issue. Thank you for your time.

    Kind Regards

    #611872

    dweb360
    Participant

    Hello
    I want to change the string in french from “Rupture de stock” to “Bientôt disponible”
    Can’t found it
    Thank you

    #611919

    Luke Nielsen
    Keymaster

    Hello,

    Try to change it via the settings of your plugin – https://prnt.sc/5FN_sDER9-0T

    https://translatepress.com/docs/translation-editor/

    Kind Regards

    #612192

    dweb360
    Participant

    Hello
    Not working because it seems that “Out of stock” is added dynamically
    Thank you

    Attachments:
    You must be logged in to view attached files.
    #612195

    Luke Nielsen
    Keymaster

    Hello,

    If there – https://prnt.sc/usHV72C2aLmf is not possible to change the text, I suggest you contact the plugin’s support because that functionality creates the translation plugin.

    Let me know the result.

    Kind Regards

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