• Resolved chaosthunder

    (@chaosthunder)


    Hi everyone!

    I am building a site of WP and facing this situation:

    – Frontend language should be in Vietnamese
    – Backend language should be in English

    I use WordPress 4.3

    In wp-config.php, I set $locale = 'vi';

    Then, in theme’s functions.php, I use the following code:

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

    The frontend displays Vietnamese OK.
    But I need Admin to display English, and now, it still displays Vietnamese.

    Please help if there is something wrong here.

    I learnt that $locale is a new way to set language for WordPress 4.0 and above. But maybe there is still something buggy?, I don’t know.

    Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with WordPress localization’ is closed to new replies.