I'm trying to translate WP theme. I have this code:
$translation = __( get_color(), 'textdomain' );
It works, I get color dynamically from get_color() function, and it translates well. But when I use "Theme Check" plugin I get error for this code.
I need to use this instead:
$translation = sprintf( __( '%s', 'textdomain' ), get_color() );
But in that case my placeholder %s doesn't translates, and I get original color name (not translated).
What I'm doing wrong? Thank you.
echo sprintf(__("text %s", 'your__text_domain'), $data);