Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The forceLocale function allows the publisher to force AdConsent to be shown in GDPR in a specific language, regardless of the user language. Passing an invalid or unsupported language code will default to 'en', or the language set through the setDefaultLocale call.

Syntax

function adconsent.gdpr()

argument name

type

optional

value

description

command

string

'forceLocale'

parameter

string

'en', 'de', 'fr', 'pt', 'it', ...

2-letter country language code. Default The default value is 'en'.

callback

function

✔️

function(message:JSON, success:boolean)

The callback function that is called with the function call result.

...

When AdConsent shows the GDPR GUI it will show it by default in the users user's browser language. forceLocale is used to override the browser language and always show the GUI in a specific language.
Using this function will allow the publisher to change the language shown to the users to a single language. This is especially useful if a site provides content only in one language, in that case, the AdConsent GUI will also show only in this forced language.
An alternative way for managing different languages is to use setDefaultLocale to show users with non-supported languages, the publishers publisher's site main language in the AdConsent GUI.

...