Setting Up Auto-Toggle (Auto language detection)

Auto-Toggle is our recommended (and the most widely used) method of implementing Multi-Language. Auto-Toggle will automatically change the language in the Player Menu based on the current language variable on your website. This method is best for performance optimization, and is strongly recommended for WalkMe solutions for Salesforce, Workday, and SuccessFactors. Click here to learn how to enable Auto-Toggle.

When Auto-Toggle is enabled, WalkMe looks for a function called walkme_get_language, which should be implemented on your website. This function should return the Language Short Name as specified during your initial language setup.

Note:The walkme_get_language function needs to be available on every page on which WalkMe has been implemented to ensure the translation always occurs. If a user manually selects a language, the Auto-Toggle will be overridden. WalkMe will remember the user’s language choice and continue to display text their chosen language.

Auto-Toggle is not available on pages in which changing the language does not trigger a page refresh, such as Single-Page Applications. If you have a Single-Page Application, use the Toggle or Language Push (API) method. If you are using WalkMe on a platform on which you cannot implement a function, such as Salesforce, contact your customer success manager or the WalkMe Support team at [email protected].

Language Push via WalkMe API

When a website does not automatically refresh after a language is selected, you may opt to use the Language Push (API) method. The Website will change the Player Menu to the correct language using an API call.

First, a function call named walkme_ready() that checks whether WalkMe is fully loaded should be implemented on your website. Once the function has loaded, WalkMe knows that it has completed loading, at which time the API call for a new language can occur. At this point, the API call WalkMeAPI.changeLanguage('language-short-name') will push the new language into the Player Menu.

WalkMeAPI Functions
WalkMeAPI.changeLanguage('language-short-name') Force WalkMe Language change to all content without requiring a page refresh.
WalkMeAPI.getAllLanguages() Returns an array of all languages defined in Multilanguage Management.
WalkMeAPI.getSupportedLanguages() Returns an array of all languages that is selectable in the language dropdown.
WalkMeAPI.getCurrentLanguage() Returns the selected language in the Player Menu as short-name.
// Change the language based on language tag (Auto-Toggle)
// Define walkme_get_language function
var walkme_get_language = function() { return 'language-short-name'; };


// Change the language with API (Language Push for SPA)
// Define walkme_ready function
var walkme_ready = function() {
  WalkMeAPI.changeLanguage('language-short-name');
};