Implement en/fr localization across admin and user UIs
Introduce client-side localization helper and en/fr locale bundles. Route admin control, picks, movies, stats, winners and settings UIs through i18n keys instead of hardcoded text. Remove French text from the English UI and standardize shared messages (saving, network errors, confirmations). Update .gitignore to ignore editor metadata and localization helper artifacts.
This commit is contained in:
+28
-11
@@ -3,13 +3,31 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Pool Oscars - Changer le mot de passe</title>
|
||||
<title data-i18n="changePassword.title">Oscar Pool - Change Password</title>
|
||||
<script src="./js/app_theme.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="./css/app.css" rel="stylesheet">
|
||||
<style>
|
||||
/* Hide translatable content until translations are ready - prevents flash during page navigation */
|
||||
body:not(.i18n-ready) [data-i18n] {
|
||||
opacity: 0;
|
||||
transition: opacity 0.1s ease-in;
|
||||
}
|
||||
body.i18n-ready [data-i18n] {
|
||||
opacity: 1;
|
||||
}
|
||||
/* Fallback: show content after 2 seconds even if JS fails */
|
||||
body:not(.i18n-ready) [data-i18n] {
|
||||
animation: show-after-delay 0.1s 2s forwards;
|
||||
}
|
||||
@keyframes show-after-delay {
|
||||
to { opacity: 1; }
|
||||
}
|
||||
</style>
|
||||
<script src="./js/localization.js" defer></script>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<button class="theme-toggle theme-toggle--floating" type="button" data-theme-toggle role="switch" aria-checked="false" aria-label="Basculer le mode sombre">
|
||||
<button class="theme-toggle theme-toggle--floating" type="button" data-theme-toggle role="switch" aria-checked="false" data-i18n-aria-label="common.toggleDarkMode" aria-label="Toggle dark mode">
|
||||
<span class="theme-toggle-icon theme-toggle-icon-sun" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="4"></circle>
|
||||
@@ -34,29 +52,29 @@
|
||||
<div class="container d-flex justify-content-center align-items-center vh-100">
|
||||
<div class="card p-4" style="max-width: 420px; width: 100%;">
|
||||
<div class="text-center mb-3">
|
||||
<img src="img/logo.png" class="logo-invert" style="width: 80%;" alt="Pool Oscars">
|
||||
<img src="img/logo.png" class="logo-invert" style="width: 80%;" alt="Oscar Pool">
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning" role="alert">
|
||||
Votre compte utilise un <strong>mot de passe temporaire</strong>. Veuillez définir un nouveau mot de passe pour continuer.
|
||||
<div class="alert alert-warning" role="alert" data-i18n="changePassword.tempPassword">
|
||||
Your account uses a <strong>temporary password</strong>. Please set a new password to continue.
|
||||
</div>
|
||||
|
||||
<div id="change-password-error" class="alert alert-danger d-none" role="alert"></div>
|
||||
|
||||
<form id="change-password-form">
|
||||
<div class="mb-3">
|
||||
<label for="new-password" class="form-label">Nouveau mot de passe</label>
|
||||
<label for="new-password" class="form-label" data-i18n="changePassword.newPassword">New password</label>
|
||||
<input type="password" class="form-control" id="new-password" minlength="8" required>
|
||||
<div class="form-text">Minimum 8 caractères.</div>
|
||||
<div class="form-text" data-i18n="changePassword.minChars">Minimum 8 characters.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="confirm-password" class="form-label">Confirmer le mot de passe</label>
|
||||
<label for="confirm-password" class="form-label" data-i18n="auth.confirmPassword">Confirm password</label>
|
||||
<input type="password" class="form-control" id="confirm-password" minlength="8" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Enregistrer</button>
|
||||
<button type="submit" class="btn btn-primary w-100" data-i18n="common.save">Save</button>
|
||||
</form>
|
||||
|
||||
<button type="button" id="log-off" class="btn btn-outline-danger w-100 mt-3">Déconnexion</button>
|
||||
<button type="button" id="log-off" class="btn btn-outline-danger w-100 mt-3" data-i18n="nav.logout">Log out</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,4 +82,3 @@
|
||||
<script src="./js/app_change-password.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user