Files
EverShelf/test.html
T
morgane 619b7b4517
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
Actualiser test.html
2026-06-17 17:42:18 +00:00

43 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>⚡ Debug Catégories - Fix</title>
<style>
body { font-family: sans-serif; background: #222; color: #eee; padding: 20px; }
table { width: 100%; border-collapse: collapse; background: #333; }
th, td { border: 1px solid #555; padding: 10px; text-align: left; }
th { background: #444; }
.key { color: #fbbf24; font-weight: bold; }
</style>
</head>
<body>
<h1>Table des Catégories (Source: translations/fr.json)</h1>
<table id="cat-table">
<thead><tr><th>Clé</th><th>Libellé (Français)</th></tr></thead>
<tbody></tbody>
</table>
<script>
fetch('translations/fr.json')
.then(res => res.json())
.then(data => {
const tbody = document.querySelector('#cat-table tbody');
// On accède directement à la section 'categories'
const catData = data.categories;
if (catData) {
Object.entries(catData).forEach(([key, val]) => {
const row = `<tr><td class="key">${key}</td><td>${val}</td></tr>`;
tbody.innerHTML += row;
});
} else {
tbody.innerHTML = "<tr><td colspan='2'>Section 'categories' non trouvée. Vérifie la console.</td></tr>";
console.log("Structure du JSON :", data);
}
})
.catch(err => alert("Erreur : " + err));
</script>
</body>
</html>