You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got some plugins (ACF, I'm specifically shaming you!) that don't pass their output through gettext, so even though I can enter the translated text (such as field labels, etc) in the usual [:en]xx[:fr]yy[:] format, it's not appearing on the page translated.
I looked through the ACF code and found that they're passing some of their untranslatable output through wp_kses, so that set me wondering if I could hook in to pre_kses to translate it myself.
So I added the below snippet and it seems to be working.
My question is, does anyone know of any reason why I shouldn't? Are there any instances where this approach - which is global by nature and can't be targeted to ACF output - might not be beneficial or could actually cause problems?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've got some plugins (ACF, I'm specifically shaming you!) that don't pass their output through gettext, so even though I can enter the translated text (such as field labels, etc) in the usual
[:en]xx[:fr]yy[:]
format, it's not appearing on the page translated.I looked through the ACF code and found that they're passing some of their untranslatable output through wp_kses, so that set me wondering if I could hook in to pre_kses to translate it myself.
So I added the below snippet and it seems to be working.
My question is, does anyone know of any reason why I shouldn't? Are there any instances where this approach - which is global by nature and can't be targeted to ACF output - might not be beneficial or could actually cause problems?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions