- 11 Oct 2024
- 2 Minutes To Read
-
Print
-
DarkLight
-
PDF
Enable Whatfix to detect the language of my app
- Updated On 11 Oct 2024
- 2 Minutes To Read
-
Print
-
DarkLight
-
PDF
Create Whatfix content in the language of your choice. The default language of content is automatically set to English. However, you can change the primary language to your preferred language. This content can also be translated and displayed according to the language that is being displayed on the application.
Here's how the same tip appears in another language:
English |
|
French |
|
To see the full list of languages supported by Whatfix, see Languages Supported by Whatfix.
There are three ways by which you can enable Whatfix to detect the language of your application.
Use the following steps to configure Whatfix to detect your language:
-
On the Whatfix Guidance dashboard, click Settings.
-
Click Advanced customisation.
In the Advanced Customization screen, you can write your own code snippet for a desired action, paste it in the window, and then click the Save button.
You can detect the language of your application using one of the three methods below:
-
The following code snippets are for the French language. To detect any other languge, replace the locale code to the respective language.
-
Based on your requirements, choose the method that best suits you and copy the code to paste it in the Advanced Customization code window.
-
Some locale codes contain a dash (-) and uppercase letters, for e.g. Brazilian Portuguese (pt-BR). While referencing a locale code in AC code however, the dash must be omitted and the uppercase letters must be made lowercase. For e.g. pt-BR should be written as ptbr.
window._wfx_settings={"locale" : "fr"};
The following HTML pages set the language information to French. These are examples:
<html>
<head>
</head>
<body>
<!-- Your HTML Code -->
</body>
<script language='javascript'>
window._wfx_settings={ "locale" : "fr"};
</script>
</html>
<html>
<head>
</head>
<body>
<!-- Your HTML Code -->
</body>
<script language='javascript'>
window._wfx_settings={ "language" : "fr"};
</script>
</html>
This style is suitable for formal deployments.
Whatfix uses wfx_locale query parameter to decide the language to be used. You can pass on language codes using this parameter. The following example triggers the french language when live mode tips are shown on this page:
http://whatfix.com/?wfx_locale=fr
This style is useful for quick testing.
Set meta tag in the pages where the live mode will run or the embed script is included.
<meta name="gwt:property" content="locale=x">
For example, the following HTML page sets locale to french:
<html>
<head>
<meta name="gwt:property" content="locale=fr">
</head>
<body>
<!-- Your HTML Code -->
</body>
</html>
- Copy the respective code snippet, paste it in the Advanced Customization code window, and then click Save.