• I’m working on a new plugin that lets users choose their admin side language. This plugin only changes the admin locale, not the entire blogs. So if u have multiple authors each author can use wordpress admin in their preferred language. Each users language setting is saved in user profile in variable WP_ADMIN_LANG. The plugin automatically detecs the language files (.mo) in wp-content/languages folder and displays a dropdown box in users profile settings.

    Everything works allready this far. But no here is the tricky part I havent found solution yet. I need to now when, and wich functions actually handles the loading of the locale. How can I override that function and can it be done by using action or filter hooks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter daily

    (@daily)

    Moved this topic to here, since the plugin is more usable in multilanguage setup of wpmu. But your help is still needed. Haven’t got a single answer so far.

    Here is a little patch to implement different languages for admin and content parts of blog.
    Just change file “wp-includes/l10n.php”
    Find function “get_locale” and make changes as shown below.

    function get_locale() {
    	global $locale;
    	if (isset($locale))
    		return apply_filters( 'locale', $locale );
    	// WPLANG is defined in wp-config.
    	if (defined('WPLANG'))
    		$locale = WPLANG;
    	if (empty($locale))
    		$locale = 'en_US';
    //!!!!Add this to function
    	if (is_admin())
    		$locale = 'en_US';
    //!!end of changes
    	return apply_filters('locale', $locale);
    }

    you can change $locale = ‘en_US’; to any language you want.
    And don’t forget to check this after every update. It can be rewritten automatically by wordpress

    I have a wordpress blog I built for an Spanish speaking artist. I work in english but want to turn over the wordpress to him in Spanish. I see the WPMU doesn’t work for the regular wordpress 2.8.

    I am not sure how to get the admin portion of wordpress to work in Spanish for him…and english for me….should I install MU and then just gen his site in Spanish?

    Thanks in advance for the time to advise….

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Admin Language Switcher’ is closed to new replies.