Skip to content

Commit

Permalink
feat: seperate language data from main js
Browse files Browse the repository at this point in the history
  • Loading branch information
malp committed Dec 21, 2023
1 parent d010740 commit 79fe219
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 120 deletions.
121 changes: 1 addition & 120 deletions cookiesettings.js
Original file line number Diff line number Diff line change
@@ -1,123 +1,4 @@
const languageData = {
'en': {
message: "We use cookies to enhance your experience. By continuing, you agree to our use of cookies.",
accept: "Accept All",
reject: "Reject All",
settings: "Cookie Settings",
moreInfo: "Learn More",
cookieModalTitle: "Cookie Settings",
scriptName: "Script Name",
scriptDescription: "Description",
scriptCategory: "Category",
scriptActions: "Actions"
},
'fr': {
message: "Nous utilisons des cookies pour améliorer votre expérience. En continuant, vous acceptez notre utilisation des cookies.",
accept: "Accepter tout",
reject: "Rejeter tout",
settings: "Paramètres des cookies",
moreInfo: "En savoir plus",
cookieModalTitle: "Paramètres des cookies",
scriptName: "Nom du script",
scriptDescription: "Description",
scriptCategory: "Catégorie",
scriptActions: "Actions"
},
'es': {
message: "Usamos cookies para mejorar tu experiencia. Al continuar, aceptas el uso de cookies.",
accept: "Aceptar Todo",
reject: "Rechazar Todo",
settings: "Configuración de Cookies",
moreInfo: "Más Información",
cookieModalTitle: "Configuración de Cookies",
scriptName: "Nombre del Script",
scriptDescription: "Descripción",
scriptCategory: "Categoría",
scriptActions: "Acciones"
},
'de': {
message: "Wir verwenden Cookies, um Ihre Erfahrung zu verbessern. Indem Sie fortfahren, stimmen Sie unserer Verwendung von Cookies zu.",
accept: "Alles akzeptieren",
reject: "Alles ablehnen",
settings: "Cookie-Einstellungen",
moreInfo: "Mehr erfahren",
cookieModalTitle: "Cookie-Einstellungen",
scriptName: "Skriptname",
scriptDescription: "Beschreibung",
scriptCategory: "Kategorie",
scriptActions: "Aktionen"
},
'tr': {
message: "Deneyiminizi iyileştirmek için çerezleri kullanıyoruz. Devam ederek çerez kullanımımızı kabul etmiş oluyorsunuz.....",
accept: "Tümünü Kabul Et",
reject: "Tümünü Reddet",
settings: "Çerez Ayarları",
moreInfo: "Daha Fazla Bilgi",
cookieModalTitle: "Cookie Ayarları",
scriptName: "Script Adı",
scriptDescription: "Açıklama",
scriptCategory: "Kategorisi",
scriptActions: "Aksiyonlar"
},'el': {
message: "Χρησιμοποιούμε cookies για να βελτιώσουμε την εμπειρία σας. Συνεχίζοντας, συμφωνείτε με τη χρήση μας των cookies.",
accept: "Αποδοχή όλων",
reject: "Απόρριψη όλων",
settings: "Ρυθμίσεις Cookies",
moreInfo: "Μάθετε περισσότερα",
cookieModalTitle: "Ρυθμίσεις Cookies",
scriptName: "Όνομα Script",
scriptDescription: "Περιγραφή",
scriptCategory: "Κατηγορία",
scriptActions: "Ενέργειες"
},
'nl': {
message: "We gebruiken cookies om uw ervaring te verbeteren. Door verder te gaan, gaat u akkoord met ons gebruik van cookies.",
accept: "Alles accepteren",
reject: "Alles afwijzen",
settings: "Cookie-instellingen",
moreInfo: "Meer leren",
cookieModalTitle: "Cookie-instellingen",
scriptName: "Scriptnaam",
scriptDescription: "Beschrijving",
scriptCategory: "Categorie",
scriptActions: "Acties"
},
'ar': {
message: "نستخدم الكوكيز لتحسين تجربتك. بالاستمرار، أنت توافق على استخدامنا للكوكيز.",
accept: "قبول الكل",
reject: "رفض الكل",
settings: "إعدادات الكوكيز",
moreInfo: "معرفة المزيد",
cookieModalTitle: "إعدادات الكوكيز",
scriptName: "اسم السكريبت",
scriptDescription: "الوصف",
scriptCategory: "الفئة",
scriptActions: "الإجراءات"
},
'pt': {
message: "Usamos cookies para melhorar sua experiência. Ao continuar, você concorda com o nosso uso de cookies.",
accept: "Aceitar tudo",
reject: "Rejeitar tudo",
settings: "Configurações de cookies",
moreInfo: "Saiba mais",
cookieModalTitle: "Configurações de cookies",
scriptName: "Nome do script",
scriptDescription: "Descrição",
scriptCategory: "Categoria",
scriptActions: "Ações"
},'it': {
message: "Utilizziamo i cookie per migliorare la tua esperienza. Continuando, accetti il nostro uso dei cookie.",
accept: "Accetta Tutto",
reject: "Rifiuta Tutto",
settings: "Impostazioni Cookie",
moreInfo: "Ulteriori Informazioni",
cookieModalTitle: "Impostazioni Cookie",
scriptName: "Nome dello Script",
scriptDescription: "Descrizione",
scriptCategory: "Categoria",
scriptActions: "Azioni"
}
};


let currentLanguage = 'en';

Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
</div>
</div>
</div>
<script src="./langData.js"></script>
<script src="./cookiesettings.js"></script>
<script type="text/javascript">
setLanguage('en');
Expand Down
120 changes: 120 additions & 0 deletions langData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
const languageData = {
'en': {
message: "We use cookies to enhance your experience. By continuing, you agree to our use of cookies.",
accept: "Accept All",
reject: "Reject All",
settings: "Cookie Settings",
moreInfo: "Learn More",
cookieModalTitle: "Cookie Settings",
scriptName: "Script Name",
scriptDescription: "Description",
scriptCategory: "Category",
scriptActions: "Actions"
},
'fr': {
message: "Nous utilisons des cookies pour améliorer votre expérience. En continuant, vous acceptez notre utilisation des cookies.",
accept: "Accepter tout",
reject: "Rejeter tout",
settings: "Paramètres des cookies",
moreInfo: "En savoir plus",
cookieModalTitle: "Paramètres des cookies",
scriptName: "Nom du script",
scriptDescription: "Description",
scriptCategory: "Catégorie",
scriptActions: "Actions"
},
'es': {
message: "Usamos cookies para mejorar tu experiencia. Al continuar, aceptas el uso de cookies.",
accept: "Aceptar Todo",
reject: "Rechazar Todo",
settings: "Configuración de Cookies",
moreInfo: "Más Información",
cookieModalTitle: "Configuración de Cookies",
scriptName: "Nombre del Script",
scriptDescription: "Descripción",
scriptCategory: "Categoría",
scriptActions: "Acciones"
},
'de': {
message: "Wir verwenden Cookies, um Ihre Erfahrung zu verbessern. Indem Sie fortfahren, stimmen Sie unserer Verwendung von Cookies zu.",
accept: "Alles akzeptieren",
reject: "Alles ablehnen",
settings: "Cookie-Einstellungen",
moreInfo: "Mehr erfahren",
cookieModalTitle: "Cookie-Einstellungen",
scriptName: "Skriptname",
scriptDescription: "Beschreibung",
scriptCategory: "Kategorie",
scriptActions: "Aktionen"
},
'tr': {
message: "Deneyiminizi iyileştirmek için çerezleri kullanıyoruz. Devam ederek çerez kullanımımızı kabul etmiş oluyorsunuz.....",
accept: "Tümünü Kabul Et",
reject: "Tümünü Reddet",
settings: "Çerez Ayarları",
moreInfo: "Daha Fazla Bilgi",
cookieModalTitle: "Cookie Ayarları",
scriptName: "Script Adı",
scriptDescription: "Açıklama",
scriptCategory: "Kategorisi",
scriptActions: "Aksiyonlar"
},'el': {
message: "Χρησιμοποιούμε cookies για να βελτιώσουμε την εμπειρία σας. Συνεχίζοντας, συμφωνείτε με τη χρήση μας των cookies.",
accept: "Αποδοχή όλων",
reject: "Απόρριψη όλων",
settings: "Ρυθμίσεις Cookies",
moreInfo: "Μάθετε περισσότερα",
cookieModalTitle: "Ρυθμίσεις Cookies",
scriptName: "Όνομα Script",
scriptDescription: "Περιγραφή",
scriptCategory: "Κατηγορία",
scriptActions: "Ενέργειες"
},
'nl': {
message: "We gebruiken cookies om uw ervaring te verbeteren. Door verder te gaan, gaat u akkoord met ons gebruik van cookies.",
accept: "Alles accepteren",
reject: "Alles afwijzen",
settings: "Cookie-instellingen",
moreInfo: "Meer leren",
cookieModalTitle: "Cookie-instellingen",
scriptName: "Scriptnaam",
scriptDescription: "Beschrijving",
scriptCategory: "Categorie",
scriptActions: "Acties"
},
'ar': {
message: "نستخدم الكوكيز لتحسين تجربتك. بالاستمرار، أنت توافق على استخدامنا للكوكيز.",
accept: "قبول الكل",
reject: "رفض الكل",
settings: "إعدادات الكوكيز",
moreInfo: "معرفة المزيد",
cookieModalTitle: "إعدادات الكوكيز",
scriptName: "اسم السكريبت",
scriptDescription: "الوصف",
scriptCategory: "الفئة",
scriptActions: "الإجراءات"
},
'pt': {
message: "Usamos cookies para melhorar sua experiência. Ao continuar, você concorda com o nosso uso de cookies.",
accept: "Aceitar tudo",
reject: "Rejeitar tudo",
settings: "Configurações de cookies",
moreInfo: "Saiba mais",
cookieModalTitle: "Configurações de cookies",
scriptName: "Nome do script",
scriptDescription: "Descrição",
scriptCategory: "Categoria",
scriptActions: "Ações"
},'it': {
message: "Utilizziamo i cookie per migliorare la tua esperienza. Continuando, accetti il nostro uso dei cookie.",
accept: "Accetta Tutto",
reject: "Rifiuta Tutto",
settings: "Impostazioni Cookie",
moreInfo: "Ulteriori Informazioni",
cookieModalTitle: "Impostazioni Cookie",
scriptName: "Nome dello Script",
scriptDescription: "Descrizione",
scriptCategory: "Categoria",
scriptActions: "Azioni"
}
};

0 comments on commit 79fe219

Please sign in to comment.