Top
Enabling Whatfix to detect the language of my app
  • 22 Mar 2022
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Enabling Whatfix to detect the language of my app

  • Dark
    Light
  • PDF

Whatfix content can be created in any language. The content is created in English by default when creating Smart tips, Flows, etc. 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 looks like 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. To configure Whatfix to detect your language

    1. Navigate to the Whatfix Dashboard.
      Goto_dashboard

    2. On the top right, click the Settings icon.
      Dashboard_clicksettings(3)

    3. Click Configuration.
      RB_dashboard_settings_configuration

    4. Click Advanced Customization
      Dashboard_theme_ac

    Use one of the methods below:

    Expose a global variable that holds language information within your Javascript

    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.

    Use URL query String

    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
    
    info
    Every page that is traversed in the flow of live run must have this parameter (wfx_locale) for whatfix to understand the locale.

    This style is useful for quick testing.

    Use Meta tag

    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>
    

    5. Copy the respective snippet and then click Save.

Was This Article Helpful?


First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.