I'm changing the locale using the locale filter. I've tried various methods; creating a plugin and hooking into filter, declaring locale filter hook in the functions.php file, and even as simply as defining my WPLANG constant; in all cases, only my theme .mo file is translated, not any of the plugins.

My custom theme .mo file loads the correct translations but not the plugins. I'm wondering why the plugins are not showing the appropriate .mo translations when locale is changed?

Here is what I have:

* Plugin Name: WM10 Locale Change
* Description: A custom function to change locale.

function wm10_change_locale($locale = '') {
    return "fr_FR";

add_filter('locale', 'wm10_change_locale', 10);

How can I have the plugins recognize the locale change and serve up the appropriate .mo translation file? Should it not be as simple as setting the WPLANG constant? I've tried everything and I can't get the plugins to output .mo translations in my specified language.

The .mo files are there, I've tried even adding them to the /wp-content/languages/plugins/ directory named appropriated {PLUGIN_NAME}-{LANGUAGE_CODE}.mo but still no luck.

  • Try the Debug Translations plugin. It can tell you where translation files are searched for.
    – fuxia
    Mar 19, 2015 at 13:09
  • Please use only one account, and if you have found a solution, write it as an answer, not as an edit to the question.
    – fuxia
    Mar 19, 2015 at 13:46

1 Answer 1


Thanks @toscho — The problem plugin in particular is wp-pagenavi. The backend strings are being translated, however; the frontend remains in default en_US locale. I found this: https://wordpress.org/support/topic/translation-91

To be more specific, the text field values on plugin options page do not get translated so my assumption is that translations are malformed somewhere in the codebase.

  • the translation API is intended for static strings, not dynamic content entered by the user or stored in the database. For that a translation/localisation plugin is required
    – Tom J Nowell
    Aug 6, 2023 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.