New Landing How can we help? Themeforest Theme Support Neighborhood Translate Neighborhood theme from english to german by .mo and .po file

Viewing 10 posts - 31 through 40 (of 40 total)
  • #291027
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Its ok.
    Thanks
    Mohammad

    #291337
    janheege
    Member
    Post count: 148

    Dear Support,

    Thanks most english words are translated to german… only “Add to shopping bag” is still in english.

    I checked the .po file and found that it is already translated but it doesn’t work.

    Best regards

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

    Hi,
    Please 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

    #291550
    janheege
    Member
    Post count: 148

    Dear Mohammad,

    Thank you for your reply!

    I paste this code into my functions.php. But it doesn’t work. I am sure I did something wrong, could you check it, please?

    See at the attachment, there is my improved functions.php file.

    My second problem is that I want to change the Text “Have a coupon…” in 1.phg. I think I can easily to this by changing the translation in the .po file (Look 2.png).

    How can I do this?

    Here is my functions.php:

    <?php
    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }
    load_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
    function sf_child_theme_locale() {
    //echo get_stylesheet_directory() . ‘/language’ ;exit;
    //load_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
    load_child_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/language’ );
    }
    //add_action( ‘init’, ‘sf_child_theme_locale’ );
    }
    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‚, ‚In den Warenkorb legen‚ ); //just change it.
    break;
    }
    return $translated_text;
    }
    ?>

    Best regards, Jan

    Attachments:
    You must be logged in to view attached files.
    #291694
    janheege
    Member
    Post count: 148

    Dear Mohammad,

    Please, reply. I need your help….

    #291711
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

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

    #291768
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have finally resolved it so please check it now.
    Thanks
    Mohammad

    #291858
    janheege
    Member
    Post count: 148

    Dear Mohammad,

    Sure?

    Please, IMPROVE

    Regards

    Attachments:
    You must be logged in to view attached files.
    #291861
    janheege
    Member
    Post count: 148

    Dear Mohammad,

    Just changed ‘ Change me ‘ and now it work perfectly :’D

    Thanks!!!!

    #291862
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Just replace the Change me with your text string in functions.php of child theme.
    Thanks
    Mohammad

Viewing 10 posts - 31 through 40 (of 40 total)

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

License required for the following item
Login and Registration Log in · Register