Title: Language button shows wrong language
Last modified: February 18, 2019

---

# Language button shows wrong language

 *  Resolved [williamhartm](https://wordpress.org/support/users/williamhartm/)
 * (@williamhartm)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/language-button-shows-wrong-language/)
 * Hi!
 * I’d like to translate a website with your plugin. The dropdown menu doesn’t show
   up when I hover the button in the header of the page, probably ’cause I use a
   custom theme. It shows the current language, I’d like to change that to the other
   language (english).
    I used this code to change the country flag and the link:
 *     ```
       if (WPGlobus.language == 'nl') {
         jQuery('.wpglobus-current-language a span').removeClass('wpglobus_flag_nl').addClass('wpglobus_flag_en');
         jQuery('.wpglobus-current-language a').attr('href', location.origin + '/en');
       } else {
         jQuery('.wpglobus-current-language a span').removeClass('wpglobus_flag_en').addClass('wpglobus_flag_nl');
         jQuery('.wpglobus-current-language a').attr('href', location.origin);
       }
       ```
   
 * Now it shows the flag of the language you’ll get when you click on it, the url
   change as well to right language.
    How can I change the language letters to the
   other language when you’ll click on it, by custom js? Check [https://epifyse.nl/](https://epifyse.nl/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flanguage-button-shows-wrong-language%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Alex Gor](https://wordpress.org/support/users/alexgff/)
 * (@alexgff)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/language-button-shows-wrong-language/#post-11220453)
 * Switcher works correctly.
    I don’t understand what you want to do more.
 *  Thread Starter [williamhartm](https://wordpress.org/support/users/williamhartm/)
 * (@williamhartm)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/language-button-shows-wrong-language/#post-11221828)
 * After I posted I’ve added two lines to the code, now it works fine!
 *     ```
       if (WPGlobus.language == 'nl') {
         jQuery('.wpglobus-current-language a span').html("EN");
         jQuery('.wpglobus-current-language a span').removeClass('wpglobus_flag_nl').addClass('wpglobus_flag_en');
         jQuery('.wpglobus-current-language a').attr('href', location.origin + '/en');
       } else {
         jQuery('.wpglobus-current-language a span').html("NL");
         jQuery('.wpglobus-current-language a span').removeClass('wpglobus_flag_en').addClass('wpglobus_flag_nl');
         jQuery('.wpglobus-current-language a').attr('href', location.origin);
       }
       ```
   
 *  Thread Starter [williamhartm](https://wordpress.org/support/users/williamhartm/)
 * (@williamhartm)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/language-button-shows-wrong-language/#post-11221831)
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Language button shows wrong language’ is closed to new replies.

 * ![](https://ps.w.org/wpglobus/assets/icon-256x256.png?rev=1069705)
 * [WPGlobus](https://wordpress.org/plugins/wpglobus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpglobus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpglobus/)
 * [Active Topics](https://wordpress.org/support/plugin/wpglobus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpglobus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpglobus/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [language](https://wordpress.org/support/topic-tag/language/)

 * 3 replies
 * 2 participants
 * Last reply from: [williamhartm](https://wordpress.org/support/users/williamhartm/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/language-button-shows-wrong-language/#post-11221831)
 * Status: resolved