-
AuthorPosts
-
March 27, 2015 at 11:35 am #236557
Hi support,
Please could you help me how to translate Read More button, it seems that wmpl doesnt gives me that string translation. (is it posible not to be hardcoded)
Here is what http://svetalata.com
March 27, 2015 at 6:07 pm #236758Hi there,
Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then add the following code into your child theme’s functions.php file and translate the “Read More” wording.
function x_excerpt_string( $more ) { $stack = x_get_stack(); if ( $stack == 'integrity' ) { return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a></div>'; } else if ( $stack == 'renew' ) { return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Read More', '__x__' ) . '</a>'; } else if ( $stack == 'icon' ) { return ' ...'; } else if ( $stack == 'ethos' ) { return ' ...'; } } add_filter( 'excerpt_more', 'x_excerpt_string' );
Hope that helps.
April 15, 2015 at 7:46 am #250178Thanks! I had the same issue and the solution helps!
April 15, 2015 at 7:59 am #250190Glad we were able to help 🙂
June 22, 2015 at 3:34 am #309112Hello,
I did the exact same procedure, but I keep on getting an error. Do you think the problem might stem from the fact that I translate from Latin letters to Cyrillic ones?
Read more -> Прочети повече
June 22, 2015 at 3:45 am #309124Hi there,
Would you clarify what error you get exactly?
Please provide us with URL as well.Thanks.
June 22, 2015 at 10:23 am #309465Parse error: syntax error, unexpected T_STRING on line 78
June 22, 2015 at 12:15 pm #309550Hi @bvganev,
Please create a new ticket, then provide 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 AccountDon’t forget to select Set as a private reply. This ensures your information is only visible to our staff.
Thanks.
July 6, 2015 at 9:51 am #322271This reply has been marked as private.July 6, 2015 at 11:10 am #322344Hi there,
Thanks for writing in!
Upon checking, I’m not seeing a child theme installed in your website. Can you please install it as per the instructions given in our earlier reply and try the following code again:
function x_excerpt_string( $more ) { $stack = x_get_stack(); if ( $stack == 'integrity' ) { return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Прочети повече', '__x__' ) . '</a></div>'; } else if ( $stack == 'renew' ) { return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Прочети повече', '__x__' ) . '</a>'; } else if ( $stack == 'icon' ) { return ' ...'; } else if ( $stack == 'ethos' ) { return ' ...'; } } add_filter( 'excerpt_more', 'x_excerpt_string' );
Let us know how it goes.
Thanks!
July 8, 2015 at 11:55 pm #325171Yes! It works seamlessly. Thank you!
About about all the other default messages in English across the site? Where can I find them in order to translate them?
July 9, 2015 at 12:08 am #325187July 19, 2015 at 9:38 am #334211Hello,
Thank you for your advice. But I don’t wish to translate the whole theme, including the admin panel. I only want to translate these few default messages, such as:
– When you search for non existing content
“Search Results Below you’ll see everything we could locate for your search of….”
“Nothing to Show Right Now It appears whatever you were looking for is no longer here or perhaps wasn’t here to begin with. You might want to try starting over from the homepage to see if you can find what you’re after from there.”– When you type in a wrong URL
“Oops! You blew up the Internet. The page you are looking for is no longer here, or never existed in the first place (bummer). You can try searching for what you are looking for using the form below. If that still doesn’t provide the results you are looking for, you can always start over from the home page.”Can I find this texts within the .PO file?
Thank you for your answer in advance!
July 19, 2015 at 9:59 am #334216Hi @bvganev,
In order to translate those strings, you can simply use following code in your child theme’s functions.php file:
add_filter('gettext', x_translate_text , 20, 3); function x_translate_text ( $translated_text, $text, $domain ) { $translation = array ( "Below you'll see everything we could locate for your search of " => "Your new text", 'Nothing to Show Right Now' => "Your new text", "It appears whatever you were looking for is no longer here or perhaps wasn't here to begin with. You might want to try starting over from the homepage to see if you can find what you're after from there." => "Your new text", 'The page you are looking for is no longer here, or never existed in the first place (bummer). You can try searching for what you are looking for using the form below. If that still doesn\'t provide the results you are looking for, you can always start over from the home page.' => "Your new text", "Oops!" => "Your new text", "You blew up the Internet. " => "Your new text", ); if( isset( $translation[$text] ) ) { return $translation[$text]; } return $translated_text; }
You can replace the “Your new text” with your texts.
Hope it helps.
August 5, 2015 at 4:06 am #350543Hi there,
is it possible to fix this via the Appearance/Custom CSS?
I have only three Things that need translation. The “Read More…” Link, the “Leave a comment” Link and the “Submit” Button.
It would be so convenient if I could change that vie the Custom CSS Field, not having to create a Child-theme.
That would be so great! Thanx a bunch!
Alex -
AuthorPosts