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

Rafael Ehlers rafaehlers at gmail.com
Wed Mar 6 20:14:24 UTC 2013


Suggestion, download the plugin qTranslate and inspect it!

2013/3/6 Manuel Schmalstieg <webdev at ms-studio.net>

> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list