franz-josef-kaiser/wcm_lang_switch — pull request #1 by stephenh1988 (2013-01-09 11:04:08+00:00)
Title: Replaces drop-down with admin bar list, fixes bug, provides format_code_lang method

Just three changes, sorry to group a bug fix with some feature changes, but I only noticed it after making some changes.

1. Replaces the drop-down menu with and sub-menu for the admin bar, I think this looks a lot nicer. The admin bar indicates which language is currently selected. As part of this, you have a link to the switch rather than posting a form (so no form, js or css is required).

2. The class needs to be initiated on `plugins_loaded` - otherwise it misses the `locale` hook. I noticed you added a callback on `locale` too - but this didn't seem to work. Maybe because `set_locale` was running too late, but then I'd expect it to take effect after another page load - but it didn't. Odd. Anyway `plugins_loaded` seems to early enough, but not so early that stuff like `wp_get_current_user()` is defined (can break some plug-ins if they trigger `locale` before `wp_get_current_user()` is defined).

3. Removing the admin notice seemed a bit hacky, at least, I wasn't sure what would happen if the notice was *meant* to be there. I've just copied the function in as a method. It's unlikely to need maintaining.