Browse Source

[Accessibilité] Ajout d'une information textuelle sur l'état courant des services.
Le RGAA Critère 3.1 prévoit : " Critère 3.1. Dans chaque page web, l’information ne doit pas être donnée uniquement par la couleur. Cette règle est-elle respectée ?"
https://www.numerique.gouv.fr/publications/rgaa-accessibilite/methode-rgaa/criteres/#topic3
Cette contrainte d'accessibilité n'est pas respectée par Tarte Au Citron car la seule information qui indique quel service est activé est la couleur du bouton.
Ce commit ajoute une mention, à côté du titre du service indiquant l'état courant du service en question.
Les traductions dans les différentes langues ont été faites avec Google Translate

Luc MULLER 4 years ago
parent
commit
be57d2a63c

+ 2 - 0
lang/tarteaucitron.bg.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "е изключен.",
+    "allowed": "Позволен",
+    "disallowed": "Забранено",
 
     "ads": {
         "title": "Рекламодатели",

+ 2 - 0
lang/tarteaucitron.ca.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "està deshabilitat.",
+    "allowed": "Permès",
+    "disallowed": "Desautoritzat",
 
     "ads": {
         "title": "Xarxa de publicitat",

+ 2 - 0
lang/tarteaucitron.cn.js

@@ -40,6 +40,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "已禁用。",
+    "allowed": "允许的",
+    "disallowed": "不允许的",
 
     "ads": {
         "title": "广告组",

+ 2 - 0
lang/tarteaucitron.cs.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "je vypnutý.",
+    "allowed": "povoleno",
+    "disallowed": "nepovoleno",
 
     "ads": {
         "title": "Reklamní síť",

+ 2 - 0
lang/tarteaucitron.da.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "er deaktiveret.",
+    "allowed": "tilladt",
+    "disallowed": "ikke tilladt",
 
     "ads": {
         "title": "Annonceringsnetværk",

+ 2 - 0
lang/tarteaucitron.de.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "ist deaktiviert.",
+    "allowed": "erlaubt",
+    "disallowed": "nicht erlaubt",
 
     "ads": {
         "title": "Werbenetzwerke",

+ 2 - 0
lang/tarteaucitron.el.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "είναι απενεργοποιημένο.",
+    "allowed": "επιτρέπεται",
+    "disallowed": "απαγορεύεται",
 
     "ads": {
         "title": "Διαφημιστικό Δίκτυο",

+ 2 - 0
lang/tarteaucitron.en.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "is disabled.",
+    "allowed": "allowed",
+    "disallowed": "disallowed",
 
     "ads": {
         "title": "Advertising network",

+ 2 - 0
lang/tarteaucitron.es.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "está deshabilitado.",
+    "allowed": "permitido",
+    "disallowed": "rechazado",
 
     "ads": {
         "title": "Red de publicidad",

+ 2 - 0
lang/tarteaucitron.fi.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
    
     "fallback": "hylätty.",
+    "allowed": "sallittu",
+    "disallowed": "kielletty",
 
     "ads": {
         "title": "Mainosverkosto",

+ 2 - 0
lang/tarteaucitron.fr.js

@@ -44,6 +44,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "est désactivé.",
+    "allowed": "autorisé",
+    "disallowed": "interdit",
 
     "ads": {
         "title": "Régies publicitaires",

+ 2 - 0
lang/tarteaucitron.hu.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "letiltott.",
+    "allowed": "megengedett",
+    "disallowed": "nem engedélyezett",
 
     "ads": {
         "title": "Reklámhálózat",

+ 2 - 0
lang/tarteaucitron.it.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "è disattivato",
+    "allowed": "permesso",
+    "disallowed": "non consentito",
     
     "ads": {
         "title": "Regie pubblicitarie",

+ 2 - 0
lang/tarteaucitron.ja.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "is disabled.",
+    "allowed": "許可",
+    "disallowed": "許可されていません",
 
     "ads": {
         "title": "Advertising network",

+ 2 - 0
lang/tarteaucitron.lv.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "letiltott.",
+    "allowed": "atļauts",
+    "disallowed": "nav atļauts",
 
     "ads": {
         "title": "Reklámhálózat",

+ 2 - 0
lang/tarteaucitron.nl.js

@@ -32,6 +32,8 @@ tarteaucitron.lang = {
     "credit": "Cookie manager mogelijk gemaakt door tarteaucitron.js",
     
     "fallback": "is uitgeschakeld.",
+    "allowed": "toegestaan",
+    "disallowed": "niet toegestaan",
 
     "toggleInfoBox": "Toon/verberg informatie over cookie opslag",
     "title": "Cookies beheer paneel",

+ 2 - 0
lang/tarteaucitron.no.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
 	"fallback" : "er skrudd av.",
+	"allowed": "tillatt",
+    "disallowed": "ikke tillatt",
 
 	"ads"      : {
 		"title"   : "Annonsenettverk",

+ 2 - 0
lang/tarteaucitron.oc.js

@@ -44,6 +44,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "es desactivat.",
+    "allowed": "allowed",
+    "disallowed": "disallowed",
 
     "ads": {
         "title": "Regias publicitàrias",

+ 2 - 0
lang/tarteaucitron.pl.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "jest nieaktywna.",
+    "allowed": "dozwolony",
+    "disallowed": "niedozwolone",
 
     "ads": {
         "title": "Sieć reklamowa",

+ 3 - 0
lang/tarteaucitron.pt.js

@@ -41,6 +41,9 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "está desativado.",
+    "allowed": "permitido",
+    "disallowed": "não permitido",
+    
     "ads": {
         "title": "Rede de anúncios",
         "details": "As redes de anúncios podem gerar receitas com a venda de espaço publicitário no site."

+ 2 - 0
lang/tarteaucitron.ro.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "este dezactivat.",
+    "allowed": "permis",
+    "disallowed": "nepermis",
 
     "ads": {
         "title": "Rețea de publicitate",

+ 2 - 0
lang/tarteaucitron.ru.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     
     
     "fallback": "Деактивирован.",
+    "allowed": "разрешается",
+    "disallowed": "запрещено",
 
     "ads": {
         "title": "Рекламная сеть",

+ 2 - 0
lang/tarteaucitron.se.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "är ur funktion.",
+    "allowed": "tillåten",
+    "disallowed": "tillåtet",
 
     "ads": {
         "title": "Annonsnätverk",

+ 2 - 0
lang/tarteaucitron.sk.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "je zakázané.",
+    "allowed": "povolený",
+    "disallowed": "nepovolený",
 
     "ads": {
         "title": "Reklamná sieť",

+ 2 - 0
lang/tarteaucitron.sv.js

@@ -42,6 +42,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "är ur funktion.",
+    "allowed": "dovoljeno",
+    "disallowed": "nedovoljeno",
 
     "ads": {
         "title": "Annonsnätverk",

+ 2 - 0
lang/tarteaucitron.tr.js

@@ -44,6 +44,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
     
     "fallback": "devre dışı.",
+    "allowed": "izin verildi",
+    "disallowed": "izin verilmeyen",
 
     "ads": {
         "title": "Reklam yönetimi",

+ 2 - 0
lang/tarteaucitron.vi.js

@@ -43,6 +43,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "tắt.",
+    "allowed": "được phép",
+    "disallowed": "không được phép",
 
     "ads": {
         "title": "Mạng quảng cáo",

+ 2 - 0
lang/tarteaucitron.zh.js

@@ -40,6 +40,8 @@ tarteaucitron.lang = {
     "icon": "Cookies",
 
     "fallback": "已禁用。",
+    "allowed": "允许的",
+    "disallowed": "不允许的",
 
     "ads": {
         "title": "广告组",

+ 25 - 12
tarteaucitron.js

@@ -17,7 +17,7 @@ var scripts = document.getElementsByTagName('script'),
 
 
 var tarteaucitron = {
-    "version": 20210310,
+    "version": 20210422,
     "cdn": cdn,
     "user": {},
     "lang": {},
@@ -391,7 +391,7 @@ var tarteaucitron = {
                 }
 
                 if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
-                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
+                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
                     //html += '<div class="tarteaucitronAlertBigWrapper">';
                     html += '   <span id="tarteaucitronDisclaimerAlert">';
                     html += '       ' + tarteaucitron.lang.alertBigPrivacy;
@@ -411,7 +411,7 @@ var tarteaucitron = {
                     //html += '</div>';
                     html += '</div>';
                 } else {
-                    html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
+                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
                     //html += '<div class="tarteaucitronAlertBigWrapper">';
                     html += '   <span id="tarteaucitronDisclaimerAlert">';
 
@@ -595,11 +595,11 @@ var tarteaucitron = {
                     }, 1500);
                 }
                 if(tarteaucitron.parameters.closePopup === true){
-                    var closeElement = document.getElementById('tarteaucitronAlertBig'),
-                        closeSpan = document.createElement('span');
-                    closeSpan.textContent = 'X';
-                    closeSpan.setAttribute('id', "tarteaucitronCloseCross");
-                    closeElement.insertBefore(closeSpan, closeElement.firstElementChild);
+                    let element = document.getElementById('tarteaucitronAlertBig');
+                    let span = document.createElement('span')
+                    span.textContent = 'X';
+                    span.setAttribute('id', "tarteaucitronCloseCross")
+                    element.insertBefore(span, element.firstElementChild)
                 }
 
 
@@ -745,14 +745,15 @@ var tarteaucitron = {
             isDenied = (cookie.indexOf(service.key + '=false') >= 0),
             isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)),
             isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0),
-            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1");
+            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"),
+            currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed;
 
         if (tarteaucitron.added[service.key] !== true) {
             tarteaucitron.added[service.key] = true;
 
             html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
             html += '   <div class="tarteaucitronName">';
-            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>';
+            html += '       <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + ' (<span id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>)</span>';
             html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';
 
             if (tarteaucitron.parameters.moreInfoLink == true) {
@@ -955,6 +956,12 @@ var tarteaucitron = {
                         if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
                         tarteaucitron.sendEvent(key + '_loaded');
                     }
+                    var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
+                    if(status == true){
+                        itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
+                    }else{
+                        itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
+                    }
                     tarteaucitron.state[key] = status;
                     tarteaucitron.cookie.create(key, status);
                     tarteaucitron.userInterface.color(key, status);
@@ -990,6 +997,12 @@ var tarteaucitron = {
                     if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); }
                 }
             }
+            var itemStatusElem = document.getElementById('tacCurrentStatus'+key);
+            if(status == true){
+                itemStatusElem.innerHTML = tarteaucitron.lang.allowed;
+            }else{
+                itemStatusElem.innerHTML = tarteaucitron.lang.disallowed;
+            }
             tarteaucitron.state[key] = status;
             tarteaucitron.cookie.create(key, status);
             tarteaucitron.userInterface.color(key, status);
@@ -1234,8 +1247,8 @@ var tarteaucitron = {
             }
             //end ie compatibility
 
-            if (document.getElementById('tarteaucitronAlertBig') !== null) {
-                document.getElementById('tarteaucitronAlertBig').focus();
+            if (document.getElementById('tarteaucitronPersonalize2') !== null) {
+                document.getElementById('tarteaucitronPersonalize2').focus();
             }
 
             window.dispatchEvent(tacOpenAlertEvent);