-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow for the modal to switch languages
- Loading branch information
Showing
5 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,11 @@ window.addEventListener("toogle-darkmode", (e) => { | |
|
||
initDarkMode(); | ||
|
||
defaultLanguage = "en"; | ||
if (window.location.href.indexOf("/es/") != -1) { | ||
defaultLanguage = "es"; | ||
} | ||
|
||
CookieConsent.run({ | ||
guiOptions: { | ||
consentModal: { | ||
|
@@ -119,18 +124,47 @@ CookieConsent.run({ | |
}, | ||
}, | ||
language: { | ||
default: "en", | ||
default: defaultLanguage, | ||
autoDetect: "browser", | ||
translations: { | ||
es: { | ||
consentModal: { | ||
title: "Hola!", | ||
description: | ||
"Por favor acepta el uso de cookies para poder seguir navegando en nuestro sitio.", | ||
acceptAllBtn: "Aceptar todo", | ||
showPreferencesBtn: "Preferencias", | ||
footer: | ||
'<a href="https://redbeard.team/privacy">Politica de privacidad</a>', | ||
}, | ||
preferencesModal: { | ||
title: "Consentimiento de cookies", | ||
acceptAllBtn: "Aceptar todo", | ||
savePreferencesBtn: "Guardar", | ||
closeIconLabel: "Cerrar", | ||
serviceCounterLabel: "Servicio|Servicios", | ||
sections: [ | ||
{ | ||
title: "Uso de cookies", | ||
description: | ||
"Utilizamos únicamente las cookies necesarias para garantizar el correcto funcionamiento del sitio web y para ejecutar 1 anuncio por página. Como el contenido es gratuito, esto es un incentivo para que todo siga funcionando. Solo hay tres cookies que puede ver: una es para mantener la información de su sesión (puramente funcional) y la segunda es una cookie seudoanónima creada por AdsTerra para ejecutar los anuncios en el sitio. La tercera cookie es cc_cookie, que se utiliza para guardar sus preferencias de cookies. Al utilizar este sitio, acepta los términos de privacidad de este sitio y mantener estas cookies mientras utilice el sitio", | ||
}, | ||
{ | ||
title: "Mas informacion", | ||
description: | ||
'Por cualquier consulta relacionada al sitio o las cookies, por favor contactarnos aqui <a class="cc__link" href="mailto:[email protected]">[email protected]</a>.', | ||
}, | ||
], | ||
}, | ||
}, | ||
en: { | ||
consentModal: { | ||
title: "Hello blogger!", | ||
description: | ||
"Please accept the usage of cookies to be able to continue browsing our site.", | ||
acceptAllBtn: "Accept all", | ||
showPreferencesBtn: "Manage preferences", | ||
footer: | ||
'<a href="https://techsquad.rocks/privacy">Privacy Policy</a>', | ||
footer: '<a href="https://redbeard.team/privacy">Privacy Policy</a>', | ||
}, | ||
preferencesModal: { | ||
title: "Consent Preferences Center", | ||
|
@@ -147,7 +181,7 @@ CookieConsent.run({ | |
{ | ||
title: "More information", | ||
description: | ||
'For any query in relation to my policy on cookies and your choices, please <a class="cc__link" href="mailto:[email protected]">[email protected]</a>.', | ||
'For any query in relation to my policy on cookies and your choices, please <a class="cc__link" href="mailto:[email protected]">[email protected]</a>.', | ||
}, | ||
], | ||
}, | ||
|
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.