humanswitch/consentcookie

Set default language through CC API

Closed this issue · 2 comments

Description

This options is very handy for multi language websites. The consent cookie can then automaticly be set by the website to the default language.

Expected Behavior

Is described in #55.

@christianvriens This is already implemented but not yet documented.

You can use the following to set the language. It works reactively

// Premise is ConsentCookie is initialized and available as global object.
// Change language to 'en'
ConsentCookie.setLanguage('en');
// Language is inmediatly changed to 'en' and the resources configured in the config with key 'en' are used.