fix: admin table i18n + emoji preservation in nav items
- Admin panel: table headers, data values, date locale-aware - Settings/help nav: emojis added to locale values (🔍🔧🔄 etc.) - auth.js: getLocale import, t() for all user-facing strings - Added common.never + 6 admin column keys - 746 locale keys per language
This commit is contained in:
+8
-6
@@ -2,7 +2,7 @@
|
||||
import { state } from './state.js';
|
||||
import { safeCreateIcons } from './utils.js';
|
||||
import { showToast, closeHeaderMenu } from './ui.js';
|
||||
import { t } from './i18n.js';
|
||||
import { t, getLocale } from './i18n.js';
|
||||
import { showWelcome } from './viewer.js';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -398,11 +398,13 @@ const AdminPanel = {
|
||||
container.innerHTML = '<p style="padding:16px;color:var(--text-muted);">Aucun utilisateur.</p>';
|
||||
return;
|
||||
}
|
||||
let html = '<table class="admin-table"><thead><tr>' + "<th>Utilisateur</th><th>Rôle</th><th>Vaults</th><th>Statut</th><th>Dernière connexion</th><th>Actions</th>" + "</tr></thead><tbody>";
|
||||
let html = '<table class="admin-table"><thead><tr>' +
|
||||
'<th>' + t('admin.col_user') + '</th><th>' + t('admin.col_role') + '</th><th>' + t('admin.col_vaults') + '</th><th>' + t('admin.col_status') + '</th><th>' + t('admin.col_last_login') + '</th><th>' + t('admin.col_actions') + '</th>' +
|
||||
'</tr></thead><tbody>';
|
||||
users.forEach((u) => {
|
||||
const vaults = u.vaults.includes("*") ? "Toutes" : u.vaults.join(", ") || "Aucune";
|
||||
const vaults = u.vaults.includes("*") ? t('common.all') : u.vaults.join(", ") || t('common.none');
|
||||
const status = u.active ? "✅" : "🔴";
|
||||
const lastLogin = u.last_login ? new Date(u.last_login).toLocaleDateString("fr-FR", { day: "numeric", month: "short", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "Jamais";
|
||||
const lastLogin = u.last_login ? new Date(u.last_login).toLocaleDateString(getLocale() === 'fr' ? 'fr-FR' : 'en-US', { day: "numeric", month: "short", year: "numeric", hour: "2-digit", minute: "2-digit" }) : t('common.never');
|
||||
html +=
|
||||
"<tr>" +
|
||||
"<td><strong>" +
|
||||
@@ -427,10 +429,10 @@ const AdminPanel = {
|
||||
'<td class="admin-actions">' +
|
||||
'<button class="admin-action-btn" data-action="edit" data-username="' +
|
||||
u.username +
|
||||
'" title="Modifier">✏️</button>' +
|
||||
'" title="' + t('common.edit') + '">✏️</button>' +
|
||||
'<button class="admin-action-btn danger" data-action="delete" data-username="' +
|
||||
u.username +
|
||||
'" title="Supprimer">🗑️</button>' +
|
||||
'" title="' + t('common.delete') + '">🗑️</button>' +
|
||||
"</td></tr>";
|
||||
});
|
||||
html += "</tbody></table>";
|
||||
|
||||
+34
-27
@@ -607,14 +607,14 @@
|
||||
"dashboard.shared_hint": "Share a document to see it appear here",
|
||||
"dashboard.quick_help": "Quick Help",
|
||||
"dashboard.ctrl_hover_tip": "Hover over a document with Ctrl for a quick preview. Click Forge in the toolbar for the advanced editor.",
|
||||
"settings.search": "Search",
|
||||
"settings.backend": "Backend",
|
||||
"settings.sync": "Sync",
|
||||
"settings.diagnostics": "Diagnostics",
|
||||
"settings.ai": "AI",
|
||||
"settings.profile": "Profile",
|
||||
"settings.about": "About",
|
||||
"settings.themes": "Themes",
|
||||
"settings.search": "🔍 Search",
|
||||
"settings.backend": "⚙️ Backend",
|
||||
"settings.sync": "🔄 Sync",
|
||||
"settings.diagnostics": "🩺 Diagnostics",
|
||||
"settings.ai": "🤖 AI",
|
||||
"settings.profile": "👤 Profile",
|
||||
"settings.about": "📦 About",
|
||||
"settings.themes": "🎨 Themes",
|
||||
"settings.search_placeholder": "Search...",
|
||||
"settings.client_label": "These settings apply immediately on the client side.",
|
||||
"settings.history_section": "Recent History",
|
||||
@@ -626,24 +626,24 @@
|
||||
"settings.history_count_desc": "Between 5 and 100 files (saved on server)",
|
||||
"settings.save": "Save",
|
||||
"settings.reindex": "Force reindex",
|
||||
"help.nav_intro": "Introduction",
|
||||
"help.nav_interface": "Interface",
|
||||
"help.nav_navigation": "Navigation",
|
||||
"help.nav_tabs": "Tabs",
|
||||
"help.nav_search": "Search",
|
||||
"help.nav_tags": "Tags",
|
||||
"help.nav_files": "Files",
|
||||
"help.nav_editing": "Editing",
|
||||
"help.nav_graph": "Graph",
|
||||
"help.nav_ai": "AI Editor",
|
||||
"help.nav_palette": "Palette",
|
||||
"help.nav_shortcuts": "Shortcuts",
|
||||
"help.nav_sharing": "Sharing",
|
||||
"help.nav_webhooks": "Webhooks",
|
||||
"help.nav_backups": "Backups",
|
||||
"help.nav_security": "Security",
|
||||
"help.nav_customization": "Customization",
|
||||
"help.nav_tips": "Tips",
|
||||
"help.nav_intro": "📘 Introduction",
|
||||
"help.nav_interface": "🧭 Interface",
|
||||
"help.nav_navigation": "🗺️ Navigation",
|
||||
"help.nav_tabs": "📑 Tabs",
|
||||
"help.nav_search": "🔍 Search",
|
||||
"help.nav_tags": "🏷️ Tags",
|
||||
"help.nav_files": "📁 Files",
|
||||
"help.nav_editing": "✏️ Editing",
|
||||
"help.nav_graph": "🗺️ Graph",
|
||||
"help.nav_ai": "🤖 AI Editor",
|
||||
"help.nav_palette": "⌨️ Palette",
|
||||
"help.nav_shortcuts": "⌨️ Shortcuts",
|
||||
"help.nav_sharing": "🔗 Sharing",
|
||||
"help.nav_webhooks": "🪝 Webhooks",
|
||||
"help.nav_backups": "💾 Backups",
|
||||
"help.nav_security": "🛡️ Security",
|
||||
"help.nav_customization": "🎨 Customization",
|
||||
"help.nav_tips": "💡 Tips",
|
||||
"help.search_placeholder": "Search help...",
|
||||
"help.toc_title": "CONTENTS",
|
||||
"help.welcome_title": "Welcome to ObsiGate",
|
||||
@@ -740,5 +740,12 @@
|
||||
"auto.3be698f6": "Favor operators",
|
||||
"auto.b86ba5ea": "Multi-criteria search",
|
||||
"auto.4fa5d7c2": "Quick editing",
|
||||
"auto.79f6e1dd": "Multi-window"
|
||||
"auto.79f6e1dd": "Multi-window",
|
||||
"admin.col_user": "User",
|
||||
"admin.col_role": "Role",
|
||||
"admin.col_vaults": "Vaults",
|
||||
"admin.col_status": "Status",
|
||||
"admin.col_last_login": "Last login",
|
||||
"admin.col_actions": "Actions",
|
||||
"common.never": "Never"
|
||||
}
|
||||
+34
-27
@@ -607,14 +607,14 @@
|
||||
"dashboard.shared_hint": "Partagez un document pour le voir apparaître ici",
|
||||
"dashboard.quick_help": "Raccourcis & Astuces",
|
||||
"dashboard.ctrl_hover_tip": "Survolez un document avec Ctrl pour un aperçu rapide. Cliquez sur Forge dans la barre d'outils pour l'éditeur avancé.",
|
||||
"settings.search": "Recherche",
|
||||
"settings.backend": "Backend",
|
||||
"settings.sync": "Synchronisation",
|
||||
"settings.diagnostics": "Diagnostics",
|
||||
"settings.ai": "IA",
|
||||
"settings.profile": "Profil",
|
||||
"settings.about": "À propos",
|
||||
"settings.themes": "Thèmes",
|
||||
"settings.search": "🔍 Recherche",
|
||||
"settings.backend": "⚙️ Backend",
|
||||
"settings.sync": "🔄 Synchronisation",
|
||||
"settings.diagnostics": "🩺 Diagnostics",
|
||||
"settings.ai": "🤖 IA",
|
||||
"settings.profile": "👤 Profil",
|
||||
"settings.about": "📦 À propos",
|
||||
"settings.themes": "🎨 Thèmes",
|
||||
"settings.search_placeholder": "Rechercher...",
|
||||
"settings.client_label": "Ces paramètres s'appliquent immédiatement côté client.",
|
||||
"settings.history_section": "Historique récent",
|
||||
@@ -626,24 +626,24 @@
|
||||
"settings.history_count_desc": "Entre 5 et 100 fichiers (sauvegarde sur le serveur)",
|
||||
"settings.save": "Sauvegarder",
|
||||
"settings.reindex": "Forcer réindexation",
|
||||
"help.nav_intro": "Introduction",
|
||||
"help.nav_interface": "Interface",
|
||||
"help.nav_navigation": "Navigation",
|
||||
"help.nav_tabs": "Onglets",
|
||||
"help.nav_search": "Recherche",
|
||||
"help.nav_tags": "Tags",
|
||||
"help.nav_files": "Fichiers",
|
||||
"help.nav_editing": "Édition",
|
||||
"help.nav_graph": "Graphe",
|
||||
"help.nav_ai": "IA Éditeur",
|
||||
"help.nav_palette": "Palette",
|
||||
"help.nav_shortcuts": "Raccourcis",
|
||||
"help.nav_sharing": "Partage",
|
||||
"help.nav_webhooks": "Webhooks",
|
||||
"help.nav_backups": "Sauvegardes",
|
||||
"help.nav_security": "Sécurité",
|
||||
"help.nav_customization": "Personnalisation",
|
||||
"help.nav_tips": "Astuces",
|
||||
"help.nav_intro": "📘 Introduction",
|
||||
"help.nav_interface": "🧭 Interface",
|
||||
"help.nav_navigation": "🗺️ Navigation",
|
||||
"help.nav_tabs": "📑 Onglets",
|
||||
"help.nav_search": "🔍 Recherche",
|
||||
"help.nav_tags": "🏷️ Tags",
|
||||
"help.nav_files": "📁 Fichiers",
|
||||
"help.nav_editing": "✏️ Édition",
|
||||
"help.nav_graph": "🗺️ Graphe",
|
||||
"help.nav_ai": "🤖 IA Éditeur",
|
||||
"help.nav_palette": "⌨️ Palette",
|
||||
"help.nav_shortcuts": "⌨️ Raccourcis",
|
||||
"help.nav_sharing": "🔗 Partage",
|
||||
"help.nav_webhooks": "🪝 Webhooks",
|
||||
"help.nav_backups": "💾 Sauvegardes",
|
||||
"help.nav_security": "🛡️ Sécurité",
|
||||
"help.nav_customization": "🎨 Personnalisation",
|
||||
"help.nav_tips": "💡 Astuces",
|
||||
"help.search_placeholder": "Rechercher dans l'aide...",
|
||||
"help.toc_title": "SOMMAIRE",
|
||||
"help.welcome_title": "Bienvenue dans ObsiGate",
|
||||
@@ -740,5 +740,12 @@
|
||||
"auto.3be698f6": "Favorisez les opérateurs",
|
||||
"auto.b86ba5ea": "Recherche multi-critères",
|
||||
"auto.4fa5d7c2": "Édition rapide",
|
||||
"auto.79f6e1dd": "Multi-fenêtres"
|
||||
"auto.79f6e1dd": "Multi-fenêtres",
|
||||
"admin.col_user": "Utilisateur",
|
||||
"admin.col_role": "Rôle",
|
||||
"admin.col_vaults": "Vaults",
|
||||
"admin.col_status": "Statut",
|
||||
"admin.col_last_login": "Dernière connexion",
|
||||
"admin.col_actions": "Actions",
|
||||
"common.never": "Jamais"
|
||||
}
|
||||
Reference in New Issue
Block a user