localization - How to disable gettext feature?

admin2025-06-02  1

Just trying to entirely disable localization support of a site.

Tried removing the gettext-filter, using override_load_textdomain-filter, and looked into every possible site with no luck. Can this be disabled entirely without hacking the core?

Just trying to entirely disable localization support of a site.

Tried removing the gettext-filter, using override_load_textdomain-filter, and looked into every possible site with no luck. Can this be disabled entirely without hacking the core?

Share Improve this question asked Mar 4, 2019 at 9:59 fabrikfabrik 1115 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You already have the answer, but perhaps you're not running your code early enough.

Returning true from the override_load_textdomain filter will prevent all MO files from loading, but you'll have to run it early to catch WordPress Core translations. Adding it as a must-use plugin does the trick for me:

/*
 Plugin Name: Disable Gettext
*/
add_filter('override_load_textdomain','__return_true');
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748843759a314189.html

最新回复(0)