[wp-hackers] Different languages in the admin and on the outside

Simon Wheatley simon at sweetinteraction.com
Tue Mar 17 07:54:08 GMT 2009


On Tue, Mar 17, 2009 at 7:40 AM, Nikolay Bachiyski <nb at nikolay.bg> wrote:
>
> It's not short of writing a new plugin, but it's really short:
>
> function different_locale_for_admin( $locale ) {
>    return is_admin()? 'en_US' : sv_SE';
> }
>
> add_filter('locale', 'different_locale_for_admin');
>

...or, with a slight tweak this version retains the ability to set the
locale in the normal place, but forces admin to a hard-coded en_US:

*untested*

function different_locale_for_admin( $locale ) {
   return is_admin()? 'en_US' : $locale;
}

add_filter('locale', 'different_locale_for_admin');

S


More information about the wp-hackers mailing list