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:
@@ -2,7 +2,7 @@
|
|||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>⚡ Debug Catégories Dynamique</title>
|
<title>⚡ Debug Catégories - Fix</title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: sans-serif; background: #222; color: #eee; padding: 20px; }
|
body { font-family: sans-serif; background: #222; color: #eee; padding: 20px; }
|
||||||
table { width: 100%; border-collapse: collapse; background: #333; }
|
table { width: 100%; border-collapse: collapse; background: #333; }
|
||||||
@@ -19,20 +19,25 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// On charge le JSON directement
|
|
||||||
fetch('translations/fr.json')
|
fetch('translations/fr.json')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const tbody = document.querySelector('#cat-table tbody');
|
const tbody = document.querySelector('#cat-table tbody');
|
||||||
// On itère sur le JSON
|
|
||||||
Object.entries(data).forEach(([key, val]) => {
|
// On accède directement à la section 'categories'
|
||||||
// On filtre pour ne garder que les entrées pertinentes
|
const catData = data.categories;
|
||||||
// (tu peux ajuster cette condition selon tes besoins)
|
|
||||||
const row = `<tr><td class="key">${key}</td><td>${val}</td></tr>`;
|
if (catData) {
|
||||||
tbody.innerHTML += row;
|
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 de chargement : " + err));
|
.catch(err => alert("Erreur : " + err));
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user