Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #398947
    Raphael
    Participant

    Hello,

    is it possible to change terms in the shop? For example I want to write “Rechnungsadress” instead of “Billing Address” (see attachment). How can I do that?

    Thanks for your support.

    Regards,
    Raphael

    #399014
    Rupok
    Member

    Hi there,

    Thanks for writing in! If you want to translate your website or some strings then you can check this page – https://community.theme.co/kb/translation/

    Hope this helps.

    Cheers!

    #399123
    Raphael
    Participant

    Hi,

    thanks for your answer.

    Am I right that I can change that in WordPress under Plugins => Editor? How can I find the correct file?

    Regards,
    Raphael

    #399305
    John Ezra
    Member

    Hi Raphael,

    Thanks for updating the thread! The process would depend on what you are actually wanting to translate. We understand that you want to translate the “Billing Address” text, but where it is located depends on what plugin you are using.

    You can use the WordPress editor, but it would be better to use FTP and code editor to edit so you have more controls in case something goes wrong and you end up with a white screen.

    How are you translating the site currently? What steps have you done and tried so far? Are you using WooCommerce?

    Please answer these questions to help us tailor our advice to your situation. After answering these questions, please also provide us your URL and login credentials via private reply so if we need to check something we can take a look. Thanks!

    #399598
    Raphael
    Participant
    This reply has been marked as private.
    #399606
    Nabeel A
    Moderator

    Hi again,

    Try out the manual string translation method by pasting the following code in your child theme’s functions.php file:

    add_filter ('gettext', 'x_translate_text', 99, 3 );
    
    function x_translate_text ( $translated_text, $text, $domain ) {
    
    $translation = array (
    'Billing Address' => 'German translated string',
    'Ship to a different address' => 'translated string',
    'Other English string' => 'translated string'
    );
    
    if( isset( $translation[$text] ) ) {
    return $translation[$text];
    }
    
    return $translated_text;
    
    }

    The $translation = array() contains the original string and the translation string. The original string should match the exact string you wish to translate. Any space or mismatched characters will invalidate the translation.

    Let us know how this goes!

    #401103
    Raphael
    Participant

    Thanks for your message.

    So it’s the only possibility to change it with the help of a child theme? Then I lose all my codings or not?

    How can I find the functions.php file? Plugins => Editor?

    Thanks for your support.

    #401229
    Darshana
    Moderator

    Hi there,

    If you edit your main X theme and place any customizations, it will overwrite when you update your theme. So we suggest you to setup a child theme first to keep your customizations separately (https://community.theme.co/kb/how-to-setup-child-themes/).

    Use a FTP client (FileZilla Client) to navigate your server directories and you can find the functions.php file in the root of your Child Theme directory once you installed it (“/root/wp-content/themes/x-child/functions.php”).

    Hope that’s clear.

    #503525
    Raphael
    Participant
    This reply has been marked as private.
    #514484
    Paul R
    Moderator

    Hi Raphael,

    There is a missing close curly bracket } at the end of your code.

    Kindly copy the as it is in your child theme’s functions.php file.

    
    add_filter ('gettext', 'x_translate_text', 99, 3 );
    function x_translate_text ( $translated_text, $text, $domain ) {
    $translation = array (
    'Billing Address' => 'German translated string',
    'Ship to a different address' => 'translated string',
    'Other English string' => 'translated string'
    );
    if( isset( $translation[$text] ) ) {
        return $translation[$text];
    }
    return $translated_text;
    }
    

    Hope that helps.

    #520319
    Raphael
    Participant

    Perfect! Thanks a lot for your support, I really appreciate your efforts.

    It works now 🙂

    #533232
    Prasant Rai
    Moderator

    You are most welcome 🙂 .

  • <script> jQuery(function($){ $("#no-reply-398947 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>