0

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?

1 Answer 1

0

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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