Jump to content

Dual Language Footer and Cookies Banner

Recommended Posts

Posted (edited)

Hello everyone,

I would need to have the cookies banner (with opt-in & out) in two different languages. is this possible? 
I followed the code from Bradgood.net for creating the dual language site

Thanks in advance for you help!

www.gyrotonicinselberlin.com 

Passw: Anneli

 

Edited by gab
  • Replies 14
  • Views 1k
  • Created
  • Last Reply

Top Posters In This Topic

Posted
6 hours ago, tuanphan said:

Hi,

Can you enable cookie banner? We can test code easier

With Footer, I answered your message, if it works, you can post here for future members

thanks a lot for you message, the footer works very well by duplicating the footer and then using this code in each of the pages:

<style>
  [data-section-id=] {
    display: none;
}
</style>

i.e. on the page I want to hide the English footer I insert the section id of the German footer and vice versa.

I activated the cookie banner again so you can have a look. Thanks a lot!

Posted
On 12/19/2022 at 8:29 PM, gab said:

Hello everyone,

I would need to have the cookies banner (with opt-in & out) in two different languages. is this possible? 
I followed the code from Bradgood.net for creating the dual language site

Thanks in advance for you help!

www.gyrotonicinselberlin.com 

Passw: Anneli

 

Can you check it again? I don't see cookies banner now

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted
8 hours ago, tuanphan said:

Can you check it again? I don't see cookies banner now

it was on all the time. But I re activated "activity log", maybe that's why you don't see it. I suppose you are checking it out with a incognito tab?

Posted
On 12/24/2022 at 2:55 AM, tuanphan said:

Can you check it again? I don't see cookies banner now

this is how it looks like:

image.thumb.png.3787e890a12ca7aa4965274ada3a7fdc.png

 

Posted

Add to Page Header of each page

<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", "new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", "new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", "new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", "new text 5");  
    });
});
</script>

If it doesnt work, try this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " new text 5");  
    });
});
</script>

image.thumb.png.9bf83499c324e1241c5196948c49ce01.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted
On 12/29/2022 at 4:40 AM, tuanphan said:

Add to Page Header of each page

<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", "new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", "new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", "new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", "new text 5");  
    });
});
</script>

If it doesnt work, try this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " new text 5");  
    });
});
</script>

image.thumb.png.9bf83499c324e1241c5196948c49ce01.png

Thanks a lot!, the second option worked out. I just modified some spacing issues so the underline text fits into the translated word.
What is left now is  how to translate the "accept" (Akzeptieren) and "decline" (ablehnen) options. And also how to link the words "Cookies" and "Privacy Policy" to the english version to their respective pages.

Posted

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " new text 5");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Akzeptieren", " accept");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Ablehnen", " accept 2");  
    });
  $('.sqs-cookie-banner-v2-text a[href*="cookies"]').attr('href','https://newcookies.com');
  $('.sqs-cookie-banner-v2-text a[href*="datenschutz"]').attr('href','https://privacypolicy.com');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 3 weeks later...
Posted
On 1/2/2023 at 7:43 AM, tuanphan said:

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " new text 5");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Akzeptieren", " accept");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Ablehnen", " accept 2");  
    });
  $('.sqs-cookie-banner-v2-text a[href*="cookies"]').attr('href','https://newcookies.com');
  $('.sqs-cookie-banner-v2-text a[href*="datenschutz"]').attr('href','https://privacypolicy.com');
});
</script>

 

Hi Tuanpan,

I have used the new code, but now it has stopped working completely. Can you detect any errors?

Posted
On 1/26/2023 at 6:27 PM, tuanphan said:

It looks like an invalid symbol. Can you send all current code?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "By using this website you agree to our use of");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " Cookies");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " We use");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " to provide useful features and measure performance to improve your experience. For more information, please see our");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " privacy policy.");  
    });
$(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Akzeptieren", " Accept);  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Ablehnen", " Decline);  
    });
  $('.sqs-cookie-banner-v2-text a[href*="cookies"]').attr('href','https://www.gyrotonicinselberlin.com/imprint/#cookies');
  $('.sqs-cookie-banner-v2-text a[href*="datenschutz"]').attr('href','https://www.gyrotonicinselberlin.com/imprint/#datenschutz');
});
});
</script>

On 1/2/2023 at 7:43 AM, tuanphan said:

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "new text");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " new text 2");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " new text 3");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " new text 4");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " new text 5");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Akzeptieren", " accept");  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Ablehnen", " accept 2");  
    });
  $('.sqs-cookie-banner-v2-text a[href*="cookies"]').attr('href','https://newcookies.com');
  $('.sqs-cookie-banner-v2-text a[href*="datenschutz"]').attr('href','https://privacypolicy.com');
});
</script>

 

Hi Tuanpan,

I have used the new code, but now it has stopped working completely. Can you detect any errors?

Posted
On 1/30/2023 at 3:44 PM, gab said:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Durch die Nutzung dieser Website stimmst Du unserer Verwendung von ", "By using this website you agree to our use of");  
    });
  $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Cookies", " Cookies");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(" zu. Wir verwenden ", " We use");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace(", um nützliche Funktionen anzubieten und die Leistung zu messen, um Dein Erlebnis zu verbessern. Weitere Informationen findest du in unserer ", " to provide useful features and measure performance to improve your experience. For more information, please see our");  
    });
   $(".sqs-cookie-banner-v2-text p").html(function() { 
          return $(this).html().replace("Datenschutzrichtlinie", " privacy policy.");  
    });
$(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Akzeptieren", " Accept);  
    });
  $(".sqs-cookie-banner-v2 button").html(function() { 
          return $(this).html().replace("Ablehnen", " Decline);  
    });
  $('.sqs-cookie-banner-v2-text a[href*="cookies"]').attr('href','https://www.gyrotonicinselberlin.com/imprint/#cookies');
  $('.sqs-cookie-banner-v2-text a[href*="datenschutz"]').attr('href','https://www.gyrotonicinselberlin.com/imprint/#datenschutz');
});
});
</script>

Hi Tuanpan,

I have used the new code, but now it has stopped working completely. Can you detect any errors?

The code looks correct. Can you duplicate the site & add me as a contributor on that duplicated? I will take a look

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 4 weeks later...
Posted

Hi Tuanpan,

sorry for the delay somehow I didn't saw the notification of your reply.

Sure you can have it, but I need your Email address for that

 

Thanks a lot

Gabriel

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.