$wp_locale keeps English terms even though locale is set to nl_NL
-
Hi all,
I’m using the following code in my functions.php file to show my website in Dutch, but keep my administration pages in English:function custom_set_my_locale($locale) { $locale = ( !is_admin() ) ? "nl_NL" : $locale; return $locale; } add_filter( 'locale', 'custom_set_my_locale' );
Everything seems to work as it should on the frontend (language_attributes() method returns lang=”nl-NL”, etc.). The only thing is that dates aren’t translated and are still shown in English. I’ve tried using the date_i18n() method, but no luck.
When I look at the $wp_locale variable all terms are still in English. As this global variable handles the date locales, I’m thinking herein lies the problem. How can I make it so that the terms in this variable are also translated into Dutch on the frontend? Any help would be appreciated.NB. I’ve added the language files from the Dutch WordPress version to the wp-content/languages folder. When I select ‘Nederlands’ as site language in the general settings, $wp_locale has the correct Dutch terms.
- The topic ‘$wp_locale keeps English terms even though locale is set to nl_NL’ is closed to new replies.