Set default language through CC API
Closed this issue · 2 comments
christianvriens commented
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.
StevenChoo commented
@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.
christianvriens commented
Documentation is added on CC website: https://www.consentcookie.nl/doc/consentcookie/technische-documentatie/#5811