Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Last active November 15, 2016 16:06
Show Gist options
  • Select an option

  • Save ahmedeshaan/3385035132085450741d08cc142f92dc to your computer and use it in GitHub Desktop.

Select an option

Save ahmedeshaan/3385035132085450741d08cc142f92dc to your computer and use it in GitHub Desktop.
<?php
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated) {
$translated = str_ireplace('Be the first to review', 'Sé el primero en comentar', $translated);
return $translated;
}
// Or
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Check out these related products', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment