Use your plugin or theme slug as the textdomain, not whatever other stupid idea you might have

This one seems obvious in hindsight. Why on earth did I not use the plugin slug as the textdomain?

Well, I didn’t. And that’s going to be a real problem soon. According to Otto, the WordPress.org plugin and theme repositories will soon include a way to handle translations. To be compatible your textdomain must match your plugin or theme slug.

If, like me, you have to update your textdomain while maintaining backwards compatibility for existing translations, here’s a handy function to do that, courtesy of johnpbloch.

Also, don’t forget the same old rules for textdomains which I also broke: it can’t be a $variable or a define( 'constant' ) or anything. Just plain text in your code. Otto covers it all.

One Comment

Comments are closed.