Skip to content
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

Closed
swissspidy opened this issue Dec 2, 2018 · 4 comments
Closed

Allow filtering internationalized strings #12516

swissspidy opened this issue Dec 2, 2018 · 4 comments
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Package] i18n /packages/i18n [Type] Enhancement A suggestion for improvement.

Comments

@swissspidy
Copy link
Member

In WordPress core, every single string that is passed to __() & co. can be filtered using the gettext filter in translate().

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.

@swissspidy swissspidy added [Type] Enhancement A suggestion for improvement. Internationalization (i18n) Issues or PRs related to internationalization efforts [Package] i18n /packages/i18n labels Dec 2, 2018
@swissspidy swissspidy self-assigned this Dec 2, 2018
@swissspidy swissspidy removed their assignment Dec 9, 2018
@gziolo
Copy link
Member

gziolo commented Oct 20, 2019

Is it a duplicate of #14833?

Well, maybe the other way around.

@leewillis77
Copy link
Contributor

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?

@kuuak
Copy link

kuuak commented Jun 30, 2020

Hello there,

I'm exactly in the same situation as @leewillis77.
I've been looking around for a solution to replace a string in the publish_panel and without a JS filter, like i18n.gettext in #12517, there is no way to change the strings.

Is there any indication wether this feature could be set for a next release?

Thanks

@gziolo
Copy link
Member

gziolo commented Jan 28, 2021

Resolved with #27966 🎉

@gziolo gziolo closed this as completed Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Package] i18n /packages/i18n [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants