I have a function to get the taxonomy term name like this:

function get_term_name($taxo){
$terms = get_terms($taxo);
$html= '';
foreach($terms as $term ) {
   $html .= sprintf( __( '%s', 'twentyfourteen' ), $term->name  ); $html .= '<br>';
   return $html;

The problem is the return string not translated. What am I done wrong?


You can not translated dynamic strings with he translation API, you can translate only static strings that you know in advance.

  • I see, is there any workaround? – dev-jim Aug 14 '14 at 3:55
  • no there isn't. How can you translate something that you don't know what it is? – Mark Kaplun Aug 14 '14 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.