如果翻译只针对归档小部件,则可能会使用过滤器函数(添加到主题的functions.php):
add_filter(\'get_archives_link\', \'translate_archive_month\');
function translate_archive_month($list) {
$patterns = array(
\'/January/\', \'/February/\', \'/March/\', \'/April/\', \'/May/\', \'/June/\',
\'/July/\', \'/August/\', \'/September/\', \'/October/\', \'/November/\', \'/December/\'
);
$replacements = array(
\'jan\', \'feb\', \'mar\', \'apr\', \'may\', \'jun\',
\'jul\', \'aug\', \'sep\', \'oct\', \'nov\', \'dec\'
);
$list = preg_replace($patterns, $replacements, $list);
return $list;
}