Tagged: x
-
AuthorPosts
-
May 5, 2016 at 11:43 am #914537
kiaallentoftParticipantHi,
How can I translate the ‘blog texts’ to Danish?
I used a template, and need to translate:
– View Post
– In
– Recent Posts
…etc.Hope you can help – see photo attached.
Thanks, Kia.
May 5, 2016 at 3:59 pm #947009
JoaoModeratorHi Kia,
Please have a look at this link.
https://community.theme.co/kb/translation/
Hope that helps,
Joao
May 6, 2016 at 2:35 pm #979190
kiaallentoftParticipantThis did not work.
I followed the steps in the article, but something is wrong. The blog is still English.I attached photo of FTP – what can I have done wrong?
I pasted the case in functions.php – does this code need editing?
Thanks ;o)
KR, Kia
May 6, 2016 at 11:17 pm #979773
Rue NelModeratorHello There,
Thanks for writing in! Please upload the
_x_-xxxx.xxfile to your server. The best place to upload is in this folderwp-content/languages/themes/and make sure that the filename is this:__x__-da_DA.po __x__-da_DA.moIf still some of the text were not translated, please add this custom function in your child theme’s functions.php file
add_filter('gettext', 'translate_text' ); function translate_text($translated) { $translated = str_ireplace('View Post', 'Insert your text translation', $translated); return $translated; }Please let us know how it goes.
May 8, 2016 at 4:36 am #980856
kiaallentoftParticipantOh, this is still not working correct.
My news page still says ‘View Post’ in the header.I uploaded the files with the correct name as you told me and also added the text to functions.php.
What could I have missed?
Thanks so much for your support!
May 8, 2016 at 4:53 am #980863
ChristianModeratorWould 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.
May 8, 2016 at 7:54 am #980972
kiaallentoftParticipantThis reply has been marked as private.May 8, 2016 at 4:00 pm #981299
RadModeratorHi there,
1. Please remove this code from your child theme’s style.css
add_filter( 'gettext', 'replace_search_string', 20, 3 ); function replace_search_string( $search_text, $text, $domain ) { if ( $text == 'Type and Press “enter” to Search' ) return __( 'Søg', $domain ); else return $search_text; } add_filter('gettext', 'translate_text' ); function translate_text($translated) { $translated = str_ireplace('View Post', 'Insert your text translation', $translated); return $translated; }2. Then add this code to your child theme’s functions.php
add_filter('gettext', 'view_post_translation', 20, 3 ); function view_post_translation( $translated_text, $text, $domain ) { $translated = ( $text == 'View Post' ? 'Se indlæg' : $translated_text ); return $translated; }Please do not add the code to child theme’s style.css, it should be added to child theme’s functions.php
CSS is for style.css, while PHP is fore functions.php
Thanks!
May 9, 2016 at 12:01 pm #982591
kiaallentoftParticipantThank you SO MUCH for your assistance. This was perfect!
Can you tell me how to translate this text also (attached photo)?
It is the comment field under each news…
Thank you.
Sunshine & smiles
May 9, 2016 at 6:08 pm #983146
JadeModeratorHi there,
Please try the suggestions here: https://community.theme.co/forums/topic/change-the-leave-a-reply-into-another-language/#post-103046
Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-914537 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
