Actualiser test.html
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
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
This commit is contained in:
@@ -1,20 +1,38 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>⚡ Debug Catégories Dynamique</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>
|
<body>
|
||||||
<h1>Table de traduction (Catégories)</h1>
|
<h1>Table des Catégories (Source: translations/fr.json)</h1>
|
||||||
<pre id="debug-out">Chargement...</pre>
|
<table id="cat-table">
|
||||||
|
<thead><tr><th>Clé</th><th>Libellé (Français)</th></tr></thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Remplace par le chemin trouvé avec le grep ci-dessus
|
// On charge le JSON directement
|
||||||
const LOCALE_PATH = '/locales/fr.json';
|
fetch('translations/fr.json')
|
||||||
|
.then(res => res.json())
|
||||||
fetch(LOCALE_PATH)
|
|
||||||
.then(r => r.json())
|
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// On extrait uniquement la partie 'categories'
|
const tbody = document.querySelector('#cat-table tbody');
|
||||||
document.getElementById('debug-out').innerText = JSON.stringify(data.categories, null, 2);
|
// On itère sur le JSON
|
||||||
|
Object.entries(data).forEach(([key, val]) => {
|
||||||
|
// On filtre pour ne garder que les entrées pertinentes
|
||||||
|
// (tu peux ajuster cette condition selon tes besoins)
|
||||||
|
const row = `<tr><td class="key">${key}</td><td>${val}</td></tr>`;
|
||||||
|
tbody.innerHTML += row;
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(e => document.getElementById('debug-out').innerText = "Erreur : " + e.message);
|
.catch(err => alert("Erreur de chargement : " + err));
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user