I'm trying to localize my plugin. I have two .mo files:


The translation works but I don't understand how to change the language to use the en_US file instead of the es_ES. This is what I'm trying:

function define_locale($locale) {
    $subdomain = array_shift(explode(".",$_SERVER['HTTP_HOST']));
    if($subdomain == "en")
        return 'en_US';
        return $locale;

// Define Locale

While get_locale() shows the locale is en_US my plugin still uses the es_ES file. What am I doing wrong?

1 Answer 1


Have you tried to add/change language flag in wp-config.php file

define ('WPLANG', 'en_GB');

REF: Installing WordPress in Your Language

  • I added a function and changed it in the wp-config based on the current url Commented Apr 3, 2014 at 15:50

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.