Skip to content

Misc

Force language

Section on how to precisely control what language and locale will be displayed to the user as well as end-recipients.

Widget

The language and locale used in the widget are by default set by the values on the authenticated user. In order to have more control over this, you can check and/or override them like in the examples below:

  • State getters: Check what language/locale are currently being used

    jsx
    Cling.ui.language > 'sv'
    
    Cling.ui.locale > 'sv-SE'
  • Init options: Set what language/locale will be used when initializing the widget

    js
    Cling.init({
      ui: {
        language: 'en',
        locale: 'en-US'
      }
    })
  • Update values: Update what language/locale should be displayed by the ui

    js
    Cling.ui.setLanguage('en')
    
    Cling.ui.setLocale('en-US')

Document

The language used in emails and while signing the documents are based on document.language. For new documents, language is set based on defaults on the account. However if you'd like to force one of our supported recipient languages (sv, en, de, es, fr, fi, nl), you can do it like the example below.

  • Example
    js
    myDoc.setProperty('language', 'sv')

Cling.destroy()

Destroys the Cling instance and removes the Cling app from the website.