Closed Nikschavan closed 8 years ago
@Nikschavan thanks for this - see https://ulrich.pogson.ch/string-text-domain-must
Hi,
Filtering text domain is not allowed.
The text domain has to be plain text, and it equals to theme slug. Yes, indeed, no other value is allowed by WordPress.org (I have my experience...).
Using a filter in text domain is the same as using it as variable I think, which is not permitted.
But maybe I'm wrong and you have some valid usecase with filtered text domains approved by WPORG?
(Please note that I'm not native English speaker and I have quite a few experience with translating WordPress ;) )
Regards,
Oliver
Thanks @webmandesign,
I did some searching about this, it seems a passing a variable in gettext functions does not work nicely with automated translations so only texts with single quotes are preferred. Learned something new today.
More info -
http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/ https://markjaquith.wordpress.com/2011/10/06/translating-wordpress-plugins-and-themes-dont-get-clever/
So, I'd say we are left with #14 option only, unfortunately...
When using this class inside a theme, theme authors will want to localize the strings with their text domain to provide unified translations.
I suggest providing a filter that will allow theme authors to override the text domain without hacking into this class.