Question

I am doing translation of my plugin. I am using __ & _e in php files. But can't figure out how to do same for config file that contains constants added using define(name, value)? Does it automatically get translated using Wordpress translation dictionary once plugin adds code for loading text-domain? Also, Do I need to use add text domain compulsorily or will Wordpress's translator will translate it even then?

Was it helpful?

Solution

WordPress doesn't automatically translate anything, you need to use the __ and _e functions, even in your config file, if you want it to be translateable.

define( 'CONSTANT', __( 'some string', 'textdomain' ) );

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top