Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1030161
    jgarciah
    Participant

    Hi.

    I tried to translate my site to Spanish. I followed the instructions as described here:

    https://community.theme.co/kb/translation/#

    The thing is that I did not install from the very beginning the child theme, so this instructions might not work for me, since you suggest to add the following code to the wp-config.php:

    add_action( ‘after_setup_theme’, ‘load_child_language’ );
    function load_child_language() {
    load_child_theme_textdomain( ‘__x__’, get_stylesheet_directory() . ‘/languages’ );
    }

    Now I did as you suggested in the alternative method:
    Alternative Upload Method

    Rather than using a child theme, you could upload your translation to /wp-content/langauges/themes, the main difference being if you upload that way, you’ll need to use the text domain of the theme/plugin you are translating in the naming of the file. For example, for this article we’d use the X text domain which is __x__ and then with the language code like this: __x__-de_DE.po and __x__-de_DE.mo

    I used the names __x__-es_ES.po and __x__-es_ES.mo for my files.

    Now, what should I do so that the translation would take effect, namely that it works? Should I change something in this code?:

    add_action( ‘after_setup_theme’, ‘load_child_language’ );
    function load_child_language() {
    load_child_theme_textdomain( ‘__x__’, get_stylesheet_directory() . ‘/languages’ );
    }

    Or there is no need to add that to the wp-config.php file?

    Thanks for your help. I’d appreciate a soon response.

    #1030757
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! You have misunderstood our article (https://community.theme.co/kb/translation/). The above code should be added to your child theme’s functions.php file.

    Please carefully go through the article and make the changes.

    Let us know if you need any further assistance.
    Thanks!

    #1040057
    jgarciah
    Participant

    Hi

    The thing is that I do not have a child theme. I installed the theme as it is. I have no child theme. So, how can I do so that the translations steps described by you in your article takes effect?
    Your article applies only for those who have installed a child theme, which is not my case. I already built my site without a child theme. And I suppose it is too late for that.

    Thanks,

    Jose Luis Garcia

    #1040066
    Rahul
    Moderator

    Hey There,

    We would strongly recommend you to have a child theme. Any file changes gets removed when there’s an update to the theme and there’s a risk of losing your changes.

    Please setup a child theme first and we would move ahead with the changes.

    Thanks for your understanding.

    #1040128
    jgarciah
    Participant

    Sorry to bother you and it would seem really basic, but I am not sure if I setup a child theme all my previous work would be lost. Or it doesn’t matter?

    #1040296
    Joao
    Moderator

    Hi There,

    No your pages and blogs are stored on the Database.

    In order to don´t lose your website styling when installing a child theme I recommend you first Going to Addons > Customizer Manager and exporting your customizer settings so when you install your child theme you can update them again in the same place, everything else will remain the same.

    Hope it helps,

    Joao

    #1040375
    jgarciah
    Participant

    I already setup the child theme as you suggested, it is active and all, and I followed really carefully the directions given in your post (https://community.theme.co/kb/translation/). But it does not work. I do not know what else to do.

    #1040898
    Christopher
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1041991
    jgarciah
    Participant

    Sorry. My mistake. I kept on uploading the files with the __x__ prefix. I corrected it and it works. Thanks for your time.

    Best regards.

    #1042607
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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