Tagged: x
-
AuthorPosts
-
June 7, 2016 at 11:04 am #1030161
jgarciahParticipantHi.
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 MethodRather 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.
June 7, 2016 at 5:01 pm #1030757
DarshanaModeratorHi 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!June 13, 2016 at 1:16 pm #1040057
jgarciahParticipantHi
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
June 13, 2016 at 1:20 pm #1040066
RahulModeratorHey 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.
June 13, 2016 at 1:57 pm #1040128
jgarciahParticipantSorry 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?
June 13, 2016 at 3:46 pm #1040296
JoaoModeratorHi 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
June 13, 2016 at 4:48 pm #1040375
jgarciahParticipantI 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.
June 14, 2016 at 1:52 am #1040898
ChristopherModeratorHi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
June 14, 2016 at 2:48 pm #1041991
jgarciahParticipantSorry. My mistake. I kept on uploading the files with the __x__ prefix. I corrected it and it works. Thanks for your time.
Best regards.
June 14, 2016 at 10:49 pm #1042607
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1030161 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
