I want to change site language through cookies.
As I have multisite, so define(‘WPLANG’) is not working in wp-config.php.
So I added hook to filter “locale”. But still not working… What to do ?
p.s I have translated .po & .mo files in “wp-content/languages/” folder.
The code in functions.php
add_filter( 'locale', 'set_my_locale', 9999 );
function set_my_locale( $lang ){
$lang = "fr_FR";
return $lang;
}
Any ideas ?
UPDATE: Created as a plugin and all worked like a charm.