Closed Zodiac1978 closed 3 years ago
You're absolutely right! I don't think this applies as much to plugins translated through the official Wordpress translate site, but maybe with multilingual plugins like WPML and the likes it's needed. Regardless, I've just released 2.0.2 to address this. Thanks again for all of this Torsten.
If things haven't changed the problem is the WordPress.org string parser which extracts the translation strings, which is written in PHP and does not execute the PHP and therefore cannot handle variables or constants: https://wordpress.stackexchange.com/a/221147
Ah, I thought it parsed it. My mistake. Ok, VERY solid advice then! Thanks again.
It is recommended to not use variables or constants as text domain.
See warning box here: https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#basic-strings