New Landing How can we help? Themeforest Theme Support Neighborhood How to translate a sentence from the Product description page

Viewing 8 posts - 1 through 8 (of 8 total)
  • #291316
    csmartgm
    Member
    Post count: 22

    Hi again,

    Attached I am sending a screenshot taken from the Product Description Page. In this page, everything is in Spanish with the exception of the sentence “ADD TO SHIPPING BAG” (see it on the picture, highlighted with a red circle).

    Could you tell me what (where) should I do to translate it.

    Thank you in advance and best regards.

    Carlos

    #291317
    csmartgm
    Member
    Post count: 22

    Sorry, I didn´t include the picture

    Attachments:
    You must be logged in to view attached files.
    #291537
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Just paste this code at functions.php of child theme.

    add_filter( 'gettext', 'sf_string_translate', 20, 3 );
    function sf_string_translate( $translated_text, $text, $domain ) {
           switch ( $translated_text ) {
            case 'Name' :
            $translated_text = __( 'Add to Shopping Bag', 'Change Me' ); //just change it.
            break;
    }
    return $translated_text;
    }

    Thanks
    Mohammad

    #291639
    csmartgm
    Member
    Post count: 22

    Hello Mohammad, thank you for yor suggestion.

    As I did not have a Child-theme, I have created it and I have created also e functions.php file, in which I have copied your code (on the code I have substituted ‘Change Me’ by the translation “Añadir al Carro”, as you can see on yhe attached picture. But after saving the changes and going back to the web page, it does not work.

    Any idea?

    Carlos

    Attachments:
    You must be logged in to view attached files.
    #291761
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me FTP login detail to check and resolve the issue.
    Thanks
    Mohammad

    #291765
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have managed to resolve the issue so please check it now.
    Thanks
    Mohammad

    #291766
    csmartgm
    Member
    Post count: 22

    Thank you very much Mohammad. It´s great.

    Best regards.
    Carlos

    #291769
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Glad 🙂 to help you.
    Thanks
    Mohammad

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register