Search Over 30,000 FREE Plugins from the Official WordPress Plugin Directory Repository

JSM's User Locale for the WordPress Toolbar

Add a quick and easy user locale / language selector in the WordPress admin back-end and front-end toolbar menus.

Add a user locale drop-down menu item in the WordPress admin back-end admin and front-end toolbar menus.

Allows users to easily change their preferred locale / language setting from the toolbar menu instead of having to update their WordPress profile page.

The default WordPress behavior is to apply the user locale preference to the admin back-end only — this plugin extends the user locale / language preference to the front-end webpage as well.

There are no plugin settings — simply install and activate the plugin.

Power-Users / Developers

See the plugin Other Notes page for information on available filters.

Do you use the Polylang plugin?

If the Polylang plugin is active, the user locale menu will automatically use the correct Polylang language URLs for the current webpage.

Do you use the WPSSO plugin?

If you're using the WordPress Social Sharing Optimization (WPSSO) plugin, the WPSSO User Locale (WPSSO UL) extension offers the same functionality, with the addition of a settings page to modify the menu icon, menu title, and enable/disable the user locale menu on the front-end.

Author JS Morisset
Profile
Contributors jsmoriss
Tags admin, back-end, front end, language, locale, polylang, select, user
  1. jsm-user-locale screenshot 1

    An example user locale language selector in the WordPress front-end toolbar menu.

Automated Install

  1. Go to the wp-admin/ section of your website.
  2. Select the Plugins menu item.
  3. Select the Add New sub-menu item.
  4. In the Search box, enter the plugin name.
  5. Click the Search Plugins button.
  6. Click the Install Now link for the plugin.
  7. Click the Activate Plugin link.

Semi-Automated Install

  1. Download the plugin archive file.
  2. Go to the wp-admin/ section of your website.
  3. Select the Plugins menu item.
  4. Select the Add New sub-menu item.
  5. Click on Upload link (just under the Install Plugins page title).
  6. Click the Browse... button.
  7. Navigate your local folders / directories and choose the zip file you downloaded previously.
  8. Click on the Install Now button.
  9. Click the Activate Plugin link.

Repositories

Version Numbering Scheme

Version components: {major}.{minor}.{bugfix}-{stage}{level}

  • {major} = Major code changes / re-writes or significant feature changes.
  • {minor} = New features / options were added or improved.
  • {bugfix} = Bugfixes or minor improvements.
  • {stage}{level} = dev < a (alpha) < b (beta) < rc (release candidate) < # (production).

Note that the production stage level can be incremented on occasion for simple text revisions and/or translation updates. See PHP's version_compare() documentation for additional information on "PHP-standardized" version numbering.

Changelog / Release Notes

Version 1.2.0-1 (2017/01/10)

  • New Features
    • Added a dashicon before the user locale menu title (default is the "translation" dashicon number 326).
  • Improvements
    • Changed the "Toolbar Menu Title" default value from "User Locale (%s)" to "%s".
  • Bugfixes
    • None
  • Developer Notes
    • Added a new 'jsm_user_locale_menu_dashicon' filter.
    • Added a new 'jsm_user_locale_menu_items' filter.

Version 1.1.4-1 (2017/01/08)

  • New Features
    • None
  • Improvements
    • None
  • Bugfixes
    • None
  • Developer Notes
    • Added a filters.txt file to document the available filter hooks.
    • Changed the 'jsm_user_locale_menu_title' filter to pass the menu title before sprintf().

Version 1.1.3-1 (2016/12/23)

  • New Features
    • None
  • Improvements
    • Added a JSM_User_Locale::check_wp_version() method hooked to 'admin_init'.
  • Bugfixes
    • None
  • Developer Notes
    • None

Version 1.1.2-1 (2016/12/21)

  • New Features
    • Added Polylang integration - the user locale menu will use the Polylang language URLs if available.
  • Improvements
    • Renamed the "Select Locale" menu title to "User Locale" and included the current locale value.
  • Bugfixes
    • None
  • Developer Notes
    • None

Version 1.0.0-1 (2016/12/17)

  • New Features
    • Initial release.
  • Improvements
    • None
  • Bugfixes
    • None
  • Developer Notes
    • None

Frequently Asked Questions

  • None

Other Notes

Additional Documentation

Developer Filters

To exclude the user locale menu item from the front-end toolbar menu, and ignore the user locale / language preference in the front-end webpage, add the following filter hook to your functions.php file:

add_filter( 'jsm_user_locale_front_end', '__return_false' );

To modify the user locale menu title (default is "%s"), you can hook the 'jsm_user_locale_menu_title' filter:

add_filter( 'jsm_user_locale_menu_title', 
    'customize_user_locale_menu_title', 10, 2 );

function customize_user_locale_menu_title( $menu_title, $menu_locale ) {
    return __( 'User Locale (%s)', 'your_text_domain' );
}

You can also modify the URL used to reload the page (after selecting a locale from the menu) by hooking the 'jsm_user_locale_redirect_url' filter.

add_filter( 'jsm_user_locale_redirect_url', 
    'customize_user_locale_redirect_url', 10, 2 );

function customize_user_locale_redirect_url( $url, $user_locale ) {
    // modify the redirect url here
    return $url;
}
Share  
Download
Version 1.2.0-1

Requires WordPress version: 4.7 or higher

Compatible up to: 4.7.2

Last Updated 11 Feb 2017

Date Added: 17 Dec 2016

Plugin Homepage

Evaluation
star1
star2
star3
star4
star5

0 stars
0 ratings
114 downloads

Compatibility

Not Enough Data

Reports:
Works: 0
Broken: 0