Tagged: x
-
AuthorPosts
-
March 23, 2016 at 9:57 am #849600
Hi,
See attached image. Where can I translate those terms into Dutch? It can’t be done through the .po and .mo files (tried, words don’t even feature there). I tried some code in functions.php to no avail. Please help! ๐
March 23, 2016 at 11:20 am #849722Hi There,
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 ( 'Your Name' => 'Your New Text', 'Your Email' => 'Your New Text', 'Your Website' => 'Your New Text', 'Your Comment *' => 'Your New Text' ); if( isset( $translation[$text] ) ) { return $translation[$text]; } return $translated_text; }
Hope it helps.
March 23, 2016 at 11:31 am #849741It did, thanks. Just one thing: it translated ‘REAGEER’ back to ‘YOUR TEXT HERE’…
Also, how can I target that button to change the text color to white?
http://www.heldenopreis.nl/held-op-sokken-gastblog-martin-akker/
March 23, 2016 at 1:14 pm #849870Hi there,
Thanks for updating.
You can add this under Custom > CSS in the Customizer..x-btn, .button, [type="submit"] { color: #fff; }
Hope this helps.
Cheers!
March 23, 2016 at 3:52 pm #850077Thanks.
Translation: after some left over code was removed it worked except for ‘Your Comment *’ => ‘Your New Text’ which remains in English. Any thoughts?
March 23, 2016 at 7:20 pm #850368Hi there,
Hmm, that’s weird. You’re correctly targeting the exact string. Would you mind changing this line of code
add_filter('gettext', 'x_translate_text' , 20, 3);
to this,
add_filter('gettext', 'x_translate_text' , 99999, 3);
Just to make sure that it’s executed after any translation. And for the meantime, you can also edit the strings directly from this file \wp-content\themes\x\framework\views\ethos\wp-comments.php and copy the same file to your child theme.
Hope this helps.
March 24, 2016 at 8:35 am #851037Both resulted in nothing ๐
March 24, 2016 at 2:48 pm #851473Hi there,
In that case, 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!
-
AuthorPosts