Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using wordpress multisite and have three different sites setup;

Default (English) German Japanese

I've got all the sites working seperately which is fine. My theme has the .mo and .po files for german and japenese in it and I have loaded the text domain in my functions.php file like so:

function custom_theme_setup() {

// Retrieve the directory for the localization files
$lang_dir = get_template_directory() . '/languages';

// Set the theme's text domain using the unique identifier from above
load_theme_textdomain('mac', $lang_dir);

} // end custom_theme_setup
add_action('after_setup_theme', 'custom_theme_setup');

How do I change the language for each site though so that the front end of the german site uses the german PO files and the front end of the japanes site uses the japanese PO files? I want the admin area to remain in english for all three sites its just the front ends that need to change

share|improve this question
add comment

1 Answer 1

You can filter locale for admin pages only:

is_admin() && add_filter( 'locale', function() {
    return 'en_US';
});
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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