0

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

1 Answer 1

1

You can filter locale for admin pages only:

is_admin() && add_filter( 'locale', function() {
    return 'en_US';
});

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.