Localization: I want the backend: english and frontend in defined language

I’d like to have the backend of WordPress in English and use a different locale for the frontend

so far I figure out perhaps I could do it by setting in the wpconfig the locale I want to use in the frontend, then add in functions.php something like this:

add_filter('locale', 'mytheme_backendlocale');
function mytheme_backendlocale($locale) {
    if ( is_admin() ) {
        return 'en_US';
    }
    return $locale;
}

is this the best practice to achieve what I want or should I do it differently?

4 s
4

Install the plugin WP Native Dashboard. Then you can set one language for the front-end in your wp-config.php and each user can choose another one for the back-end.
See Change language of comments template for details and a screenshot.

Leave a Comment