Skip to content

Can I use getConfig? / How #221

Answered by orestbida
JiriBandura asked this question in Q&A
Discussion options

You must be logged in to vote

@JiriBandura,

this is fairly easy to achieve!

You need to have a .js file — for the sake of this example I'll name it cc_languages.js — with the following structure:

window.cc_languages = {
    'en': {
        consent_modal: {
            title: ' We use cookies!',
            description: '...',
            // ...
        },
        settings_modal: {
            // ...
        }
    },
    'de': {
        // ...
    }
}

You will then need to load cc_languages.js file before running the plugin:

// obtain plugin
var cc = initCookieConsent();

// load languages
cc.loadScript('cc_languages.js', function(){
    // run plugin
    cc.run({
        current_lang: 'en',
        // ...
    
        l…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by orestbida
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants