[wp-hackers] Using constants for text domain

Justas Butkus jbutkus at time.ly
Wed Nov 27 14:03:02 UTC 2013


Given that we generate the POT files on our own (extending existing 
tools, i.e. MakePOT) - these issues seems to be related only to building 
of the release package, and not running the script itself? Or am I still 
missing something?

While the benefit of that seems the possibility to catch text-domain 
misuse error early. I mean with function call it either fails, if you 
mistype it's name, or returns the correct result, and the process is 
reentrable. Whilst using static text string it may get silently ignored, 
creating new text domains.


-- 
Thanks for the response,
Justas Butkus

2013.11.27 15:57, J.D. Grimes rašė:
> The reason that your setup is a bad idea is because it won’t be possible to generate the POT file automatically with the available programs. Your text domain should always be a string, otherwise the POT generators won’t pick it up properly. The same also goes for the strings being gettexted, which is why, although your system will work, it won’t be easy to generate your POT files automatically. The POT generator won’t recognize your functions as gettext functions, so it won’t pick up those strings either.
>
> -J.D.



More information about the wp-hackers mailing list