[wp-hackers] Multilanguage: how to redefine locale on the fly

Manuel Schmalstieg webdev at ms-studio.net
Wed Mar 6 13:23:51 UTC 2013

One more observation:

The filter below *does* work partly, I can see that the
language_attributes() in my header.php template react upon it,
switching to lang="de_DE".

But the date_i18n() function, and terms defined in the po/mo files
with _e(), are not reacting to the locale change. How can I persuade
them to collaborate?

> If I try using a filter in functions.php:
> function nfo_redefine_locale($locale) {
>   global $locale;
>   $locale = 'de_DE';
>   return $locale;
> }
> add_filter('locale','nfo_redefine_locale');
> ...it still doesn't switch the output to German.

More information about the wp-hackers mailing list