-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow filtering internationalized strings #12516
Comments
Is it a duplicate of #14833? Well, maybe the other way around. |
Hi; I'm jumping into this after reading the linked PR (#12517). I'm the author of the Say What? plugin (https://wordpress.org/plugins/say-what/) which uses the PHP gettext filters extensively to do it's job. Currently there's no way (that I can tell) that it can do the same job on JS strings without that PR (or an alternative) landing. It looks like other plugins have similar issues (https://wordpress.org/support/topic/wp_set_script_translations/) #12517 was closed but without a clarifying comment about the status so I'm unsure where things lie currently. I don't think the filters have been added. Is there anything I can do to help quantify the need, discuss potential solutions / test? |
Hello there, I'm exactly in the same situation as @leewillis77. Is there any indication wether this feature could be set for a next release? Thanks |
Resolved with #27966 🎉 |
In WordPress core, every single string that is passed to
__()
& co. can be filtered using thegettext
filter intranslate()
.Arguments to that filter are the original text, the translation, and the text domain.
For ultimate flexibility, I suggest adding the same filters to gettext functions in the i18n package.
The text was updated successfully, but these errors were encountered: