When you don’t want to create the separate .po file or install the translation plugin for a couple of phrases 🙂
function custom_doc_translations($translated){
$text = array(
'Search Results for' => 'Результаты поиска',
'Category' => 'Категория',
);
$translated = str_ireplace( array_keys($text), $text, $translated );
return $translated;
}
add_filter( 'gettext', 'custom_doc_translations', 99 );