Skip to content

Instantly share code, notes, and snippets.

@smeevil
Created June 5, 2012 15:37
Show Gist options
  • Save smeevil/2875769 to your computer and use it in GitHub Desktop.
Save smeevil/2875769 to your computer and use it in GitHub Desktop.
Cookie control translation
//Add this after your cookie control script
function TranslateCookieControl(){
var cookieControlTitle="Cookie Acceptatie";
var cookieControlOkButton="Ik ga hiermee akkoord !";
var cookieControlMoreInfoButton="Meer info"
var cookieControlLessInfoButton="Minder info"
$('p.ccc-about').remove();
$('#ccc-go').html(cookieControlOkButton);
$('.ccc-inner').children().first().html(cookieControlTitle);
$('.ccc-expand').html("Meer info");
function ChangeCookieControlButtonText(){
if ($('.ccc-expand').html()=="read less"){
$('.ccc-expand').html(cookieControlLessInfoButton);
}else{
$('.ccc-expand').html( cookieControlMoreInfoButton);
}
}
$('.ccc-expand').bind('click', function(e){ChangeCookieControlButtonText();setTimeout(function(){;ChangeCookieControlButtonText()},300)})
}
//Then in your cookie control script change the onReady function from :
onReady:function(){},
to :
onReady:function(){TranslateCookieControl()},
//Thats it , enjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment