For this text string, you can use Westi’s method at http://blog.ftwr.co.uk/archives/2010/01/02/mangling-strings-for-fun-and-profit/
You can add the following code in your theme’s functions.php
`<?php
/* http://blog.ftwr.co.uk/archives/2010/01/02/mangling-strings-for-fun-and-profit/ */
class PJW_Translation_Mangler {
function filter_gettext($translation, $text, $domain) {
$translations = &get_translations_for_domain( $domain );
if ( $text == ‘%s wrote a new blog post: %s’ ) {
return $translations->translate( ‘%s wrote: %s’ );
}
return $translation;
}
}
add_filter(‘gettext’, array(‘PJW_Translation_Mangler’, ‘filter_gettext’), 10, 4);
?>
`
@mercime oh awesome! needed that.
I adapted it a little, to display a link to the category the post is in (assuming one category, and category slug of ‘category’) :
`class PJW_Translation_Mangler {
function filter_gettext($translation, $text, $domain) {
global $post;
$category = get_the_category($post->ID);
$cat_slug = $category[0]->slug;
$category = $category[0]->cat_name;
$translations = &get_translations_for_domain( $domain );
if ( $text == ‘%s wrote a new blog post: %s’ ) {
return $translations->translate( ‘%s wrote a new post: %s, in ‘.$category.’‘);
}
return $translation;
}
}
add_filter(‘gettext’, array(‘PJW_Translation_Mangler’, ‘filter_gettext’), 10, 4);`