Details
Description
I found a small (but frustrating) bug in how ts() handles the gettext domain changes for extensions.
- sometimes the $params['domain'] is empty, not null, so it goes through useless lookups for extensions
- CRM_Core_I18n::setGettextDomain() was not returning anything, but then the return value was used to change the domain back afterwards.. this led to weird things happening sometimes.
I also added support for phpgettext translation of extensions. It works, but I can't vouch for the performance, since phpgettext is horribly slow, but presumably it's not much slower than just translating for core.