Jump to content

Dual Language Footer and Cookies Banner

Recommended Posts

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
Link to comment
  • Replies 14
  • Views 556
  • Created
  • Last Reply

Top Posters In This Topic

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!

Link to comment
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!)

Link to comment
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?

Link to comment

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!)

Link to comment
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.

Link to comment

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!)

Link to comment
  • 3 weeks later...
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?

Link to comment
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?

Link to comment
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!)

Link to comment
  • 4 weeks later...
On 2/28/2023 at 3:39 PM, gab said:

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

You can send via private message

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!)

Link to comment

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.