How do I go about translating custom taxonomy terms?
I am essentially trying to allow authors to see the terms in English and let the subscribers see the terms in Spanish.
I am not running a multilingual site in the sense that posts and such are translated, so plugins like qTranslate don’t address my need.
The closest thing I’ve seen is an old plugin called ZDMultilang which supports term translation (tags, categories and link categories).
I’ve also found some solutions like this one – Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php:
add_filter( 'gettext', 'wpse6096_gettext', 10, 2 );
function wpse6096_gettext( $translation, $original )
{
if ( 'Nickname' == $original ) {
return 'Funny name';
}
if ( 'Biographical Info' == $original ) {
return 'Resume';
}
return $translation;
}
But a) it doesn’t seem to be working on my site, and b) I’d need to add a conditional that checks the language the user has selected to view the site in (I suppose get_bloginfo('language')
).
I haven’t tried this myself but theoretically it should work. It just requires some hacking.
First of all, this involves using qTranslate. If you don’t want a multilingual site, you can always fill only the default language. Then to force display only the default language on the post pages, you will need to modify the core qTranslate file:
http://www.qianqin.de/qtranslate/forum/viewtopic.php?t=1777#p8303
And to enable translation for custom taxonomy terms, you need to create a function:
http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=4&t=2045&start=0#p7380
Hopefully, this will fulfill your needs.