Skip to content

Instantly share code, notes, and snippets.

@scysys
Created July 18, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scysys/c98f3efb86de92b75489 to your computer and use it in GitHub Desktop.
Save scysys/c98f3efb86de92b75489 to your computer and use it in GitHub Desktop.
Wordpress String Translate
function stringtranslate_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Post Comment' => 'Hinterlassen Sie eine Antwort',
);
if ( isset( $strings[$original] ) ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'stringtranslate_filter_gettext', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment