feat(i18n): traduire l'ensemble des gabarits

Le site s'affiche desormais integralement en francais. 483 chaines, aucune
non traduite, dans les deux catalogues.

Couvert : navigation et mise en page partagee, connexion, les cinq pages
d'erreur, et les 29 gabarits de pages.

Methode
  Marquage semi-automatique, conservateur par construction : seuls des
  motifs sans ambiguite sont balises -- contenu de balises de texte,
  attributs placeholder/title/aria-label, texte suivant une icone, blocs
  title et page_title -- et tout contenu comportant du Jinja ou du balisage
  imbrique est laisse de cote. Deux passes, la seconde pour td, li, h6,
  strong, em et caption.

  97 entrees etaient marquees fuzzy par pybabel update, c'est-a-dire
  devinees par similarite. Une entree fuzzy est **ignoree a l'execution** :
  elles ont donc ete traitees comme non traduites, et le drapeau retire une
  fois la traduction ecrite.

Deux pieges rencontres, tous deux documentes dans docs/translations.md

  Une entite HTML n'est pas du texte. ×, utilise comme libelle de
  bouton de fermeture, a ete balise par la passe automatique. Jinja
  l'echappait alors en × et le bouton aurait affiche le texte
  litteral × au lieu de la croix. Corrige dans cinq gabarits.

  Huit chaines subsistent dans des blocs <script>. Elles fonctionnent mais
  restent fragiles : Jinja echappe & < > " ' dans un bloc script, et ces
  entites n'y sont pas decodees -- une traduction contenant une apostrophe
  droite arriverait dans la chaine JavaScript sous la forme &#39;. Le
  francais retenu utilise des apostrophes typographiques, non echappees,
  donc l'existant est sur. Toute nouvelle chaine a cet endroit devra passer
  par un attribut data- ou un bloc <script type="application/json">.

Vocabulaire retenu -- a valider avec le club
  tryout -> selection · manager -> gerant · coach -> coach (conserve, terme
  d'usage en e-sport) · scout -> recruteur · email -> courriel · scrim ->
  scrim. Les noms de jeux et les postes (Support, Duelist, AWPer) restent
  en anglais : ce sont les termes employes par les joueurs.
  Ces choix vivent dans un seul catalogue, donc chacun se change en un
  endroit.

Reste a faire : les messages flash hors routes/auth.py, et les messages de
validation de app/validators.py, qui necessitent lazy_gettext puisque les
champs de schema sont construits a l'import.

Verifie : 13 pages parcourues dans les deux langues, aucune ne laisse de
marqueur Jinja non evalue ni d'entite doublement echappee. 193 tests.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
GGThed
2026-08-07 21:43:29 -04:00
co-authored by Claude Opus 5
parent fcb58e8a17
commit 80bc1413f1
34 changed files with 4256 additions and 708 deletions
+51 -51
View File
@@ -1,12 +1,12 @@
{% extends "layouts/base.html" %}
{% block title %}Teams - TryoutPro{% endblock %}
{% block page_title %}Teams{% endblock %}
{% block title %}{{ _('Teams') }} - TryoutPro{% endblock %}
{% block page_title %}{{ _('Teams') }}{% endblock %}
{% block breadcrumb %}<span class="breadcrumb">Home / Teams</span>{% endblock %}
{% block header_actions %}
{% if can_manage %}
<button class="btn btn-primary" data-action="show-create-form">
<i class="fas fa-plus"></i> New Team
<i class="fas fa-plus"></i> {{ _('New Team') }}
</button>
{% endif %}
{% endblock %}
@@ -15,29 +15,29 @@
{% if can_manage %}
<div id="createTeamForm" class="card mb-4 {% if not form_visible %}hidden{% endif %}">
<div class="card-header">
<h3>Create New Team</h3>
<h3>{{ _('Create New Team') }}</h3>
</div>
<div class="card-body">
<form method="POST" action="{{ url_for('teams.create_team') }}" class="form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<div class="form-row">
<div class="form-group col-4">
<label for="name">Team Name</label>
<input type="text" id="name" name="name" placeholder="e.g., Varsity, JV, U14" required>
<label for="name">{{ _('Team Name') }}</label>
<input type="text" id="name" name="name" placeholder="{{ _('e.g., Varsity, JV, U14') }}" required>
</div>
<div class="form-group col-4">
<label for="coach_id">Assigned Coach</label>
<label for="coach_id">{{ _('Assigned Coach') }}</label>
<select id="coach_id" name="coach_id" class="form-select">
<option value="">-- No coach assigned --</option>
<option value="">{{ _('-- No coach assigned --') }}</option>
{% for coach in coaches %}
<option value="{{ coach.id }}">{{ coach.username }}</option>
{% endfor %}
</select>
</div>
<div class="form-group col-4">
<label for="manager_id">Assigned Manager</label>
<label for="manager_id">{{ _('Assigned Manager') }}</label>
<select id="manager_id" name="manager_id" class="form-select">
<option value="">-- No manager assigned --</option>
<option value="">{{ _('-- No manager assigned --') }}</option>
{% for manager in managers %}
<option value="{{ manager.id }}">{{ manager.username }}</option>
{% endfor %}
@@ -45,8 +45,8 @@
</div>
</div>
<div class="form-actions">
<button type="button" class="btn btn-secondary" data-action="hide-create-form">Cancel</button>
<button type="submit" class="btn btn-primary">Create Team</button>
<button type="button" class="btn btn-secondary" data-action="hide-create-form">{{ _('Cancel') }}</button>
<button type="submit" class="btn btn-primary">{{ _('Create Team') }}</button>
</div>
</form>
</div>
@@ -61,18 +61,18 @@
<div class="card-actions">
{% if can_manage %}
<button class="btn btn-sm btn-outline edit-team-btn" data-team-id="{{ team.id }}" data-team-name="{{ team.name }}" data-coach-id="{{ team.coach_id or '' }}" data-manager-id="{{ team.manager_id or '' }}">
<i class="fas fa-edit"></i> Edit
<i class="fas fa-edit"></i> {{ _('Edit') }}
</button>
<form method="POST" action="{{ url_for('teams.delete_team', team_id=team.id) }}" class="inline-form" data-confirm="{{ _('Delete team %(name)s? It will be unassigned from any linked tryouts.', name=team.name) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-sm btn-danger">
<i class="fas fa-trash"></i> Delete
<i class="fas fa-trash"></i> {{ _('Delete') }}
</button>
</form>
{% endif %}
{% if current_user.role == 'coach' and team.coach_id == current_user.id %}
<a href="{{ url_for('users.notes_dashboard') }}" class="btn btn-sm btn-primary" title="Add Notes">
<i class="fas fa-sticky-note"></i> Notes
<a href="{{ url_for('users.notes_dashboard') }}" class="btn btn-sm btn-primary" title="{{ _('Add Notes') }}">
<i class="fas fa-sticky-note"></i> {{ _('Notes') }}
</a>
{% endif %}
</div>
@@ -81,7 +81,7 @@
<div class="team-staff-bar">
<div class="staff-row">
<div class="staff-group">
<span class="staff-label"><i class="fas fa-chalkboard-teacher"></i> Coaches</span>
<span class="staff-label"><i class="fas fa-chalkboard-teacher"></i> {{ _('Coaches') }}</span>
<div class="staff-items">
{% set team_coaches = team.get_coaches() %}
{% if team_coaches %}
@@ -92,7 +92,7 @@
<form method="POST" action="{{ url_for('teams.remove_coach', team_id=team.id) }}" class="inline-form" data-confirm="{{ _('Remove coach %(coach)s from %(team)s?', coach=c.username, team=team.name) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="coach_id" value="{{ c.id }}"/>
<button type="submit" class="btn-icon-sm" title="Remove Coach">&times;</button>
<button type="submit" class="btn-icon-sm" title="{{ _('Remove Coach') }}">&times;</button>
</form>
{% endif %}
</span>
@@ -103,7 +103,7 @@
</div>
</div>
<div class="staff-group">
<span class="staff-label"><i class="fas fa-user-tie"></i> Managers</span>
<span class="staff-label"><i class="fas fa-user-tie"></i> {{ _('Managers') }}</span>
<div class="staff-items">
{% set team_managers = team.get_managers() %}
{% if team_managers %}
@@ -114,7 +114,7 @@
<form method="POST" action="{{ url_for('teams.remove_manager', team_id=team.id) }}" class="inline-form" data-confirm="{{ _('Remove manager %(manager)s from %(team)s?', manager=m.username, team=team.name) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="manager_id" value="{{ m.id }}"/>
<button type="submit" class="btn-icon-sm" title="Remove Manager">&times;</button>
<button type="submit" class="btn-icon-sm" title="{{ _('Remove Manager') }}">&times;</button>
</form>
{% endif %}
</span>
@@ -124,15 +124,15 @@
{% endif %}
</div>
</div>
<a href="{{ url_for('team_matches.list_matches') }}?team_id={{ team.id }}" class="btn btn-sm btn-outline" title="View Team Matches">
<i class="fas fa-futbol"></i> Matches
<a href="{{ url_for('team_matches.list_matches') }}?team_id={{ team.id }}" class="btn btn-sm btn-outline" title="{{ _('View Team Matches') }}">
<i class="fas fa-futbol"></i> {{ _('Matches') }}
</a>
{% if current_user.can_schedule_matches() and (current_user.role in ['admin', 'manager'] or (current_user.role == 'coach' and team.coaches.filter_by(id=current_user.id).first()) or (current_user.role == 'coach' and team.coach_id == current_user.id)) %}
<a href="{{ url_for('team_matches.create_match', team_id=team.id) }}" class="btn btn-sm btn-success" title="Schedule Team Match">
<i class="fas fa-plus"></i> Match
<a href="{{ url_for('team_matches.create_match', team_id=team.id) }}" class="btn btn-sm btn-success" title="{{ _('Schedule Team Match') }}">
<i class="fas fa-plus"></i> {{ _('Match') }}
</a>
<a href="{{ url_for('team_matches.create_match', team_id=team.id, type='practice') }}" class="btn btn-sm btn-info" title="Schedule Practice">
<i class="fas fa-dumbbell"></i> Practice
<a href="{{ url_for('team_matches.create_match', team_id=team.id, type='practice') }}" class="btn btn-sm btn-info" title="{{ _('Schedule Practice') }}">
<i class="fas fa-dumbbell"></i> {{ _('Practice') }}
</a>
{% endif %}
</div>
@@ -142,13 +142,13 @@
<table class="table">
<thead>
<tr>
<th>Player</th>
<th>Status</th>
<th>Position / Role</th>
<th>Email</th>
<th>Phone</th>
<th>{{ _('Player') }}</th>
<th>{{ _('Status') }}</th>
<th>{{ _('Position / Role') }}</th>
<th>{{ _('Email') }}</th>
<th>{{ _('Phone') }}</th>
{% if can_manage_team %}
<th>Actions</th>
<th>{{ _('Actions') }}</th>
{% endif %}
</tr>
</thead>
@@ -183,7 +183,7 @@
<form method="POST" action="{{ url_for('teams.remove_player', team_id=team.id, player_id=entry.player.id) }}" class="inline-form" data-confirm="{{ _('Remove %(player)s from %(team)s?', player=entry.player.username, team=team.name) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-sm btn-danger">
<i class="fas fa-user-minus"></i> Remove
<i class="fas fa-user-minus"></i> {{ _('Remove') }}
</button>
</form>
</td>
@@ -194,9 +194,9 @@
<td colspan="{% if can_manage_team %}6{% else %}5{% endif %}" class="text-center">
<div class="empty-state">
<i class="fas fa-users-slash"></i>
<h4>No players assigned</h4>
<h4>{{ _('No players assigned') }}</h4>
{% if can_manage_team %}
<p>Add players to this team using the form below.</p>
<p>{{ _('Add players to this team using the form below.') }}</p>
{% endif %}
</div>
</td>
@@ -213,7 +213,7 @@
<form method="POST" action="{{ url_for('teams.add_player', team_id=team.id) }}" class="form-inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="player_id" class="form-select" required>
<option value="">-- Select a player --</option>
<option value="">{{ _('-- Select a player --') }}</option>
{% for p in all_players %}
{% if p.id not in team.players | map(attribute='id') %}
<option value="{{ p.id }}">{{ p.username }}</option>
@@ -221,11 +221,11 @@
{% endfor %}
</select>
<select name="status" class="form-select ml-2">
<option value="starter">Starter</option>
<option value="substitute">Substitute</option>
<option value="starter">{{ _('Starter') }}</option>
<option value="substitute">{{ _('Substitute') }}</option>
</select>
<button type="submit" class="btn btn-sm btn-primary ml-2">
<i class="fas fa-plus"></i> Add to Team
<i class="fas fa-plus"></i> {{ _('Add to Team') }}
</button>
</form>
</div>
@@ -237,12 +237,12 @@
<div class="card-body text-center">
<div class="empty-state">
<i class="fas fa-users-cog"></i>
<h3>No teams yet</h3>
<h3>{{ _('No teams yet') }}</h3>
{% if can_manage %}
<p>Create organization teams and assign coaches to manage tryouts.</p>
<button class="btn btn-primary" data-action="show-create-form">Create Team</button>
<p>{{ _('Create organization teams and assign coaches to manage tryouts.') }}</p>
<button class="btn btn-primary" data-action="show-create-form">{{ _('Create Team') }}</button>
{% else %}
<p>There are no teams to display.</p>
<p>{{ _('There are no teams to display.') }}</p>
{% endif %}
</div>
</div>
@@ -254,7 +254,7 @@
<div class="modal-backdrop" data-action="hide-edit-form"></div>
<div class="modal-content">
<div class="modal-header">
<h3>Edit Team</h3>
<h3>{{ _('Edit Team') }}</h3>
<button class="modal-close" data-action="hide-edit-form">&times;</button>
</div>
<div class="modal-body">
@@ -263,37 +263,37 @@
<input type="hidden" name="sync_staff" value="1"/>
<div class="form-group">
<label for="edit_name">Team Name</label>
<label for="edit_name">{{ _('Team Name') }}</label>
<input type="text" id="edit_name" name="name" required>
</div>
<hr class="section-divider">
<!-- Manage Coaches -->
<h5 class="mb-2"><i class="fas fa-chalkboard-teacher"></i> Coaches</h5>
<h5 class="mb-2"><i class="fas fa-chalkboard-teacher"></i> {{ _('Coaches') }}</h5>
<div class="form-group">
<select name="coach_ids" id="edit-coach-select" class="form-select" multiple style="min-height: 100px; width: 100%;">
{% for coach in coaches %}
<option value="{{ coach.id }}" class="coach-option">{{ coach.username }}</option>
{% endfor %}
</select>
<small class="form-text">Hold Ctrl/Cmd to select multiple. Only unassigned coaches shown.</small>
<small class="form-text">{{ _('Hold Ctrl/Cmd to select multiple. Only unassigned coaches shown.') }}</small>
</div>
<!-- Manage Managers -->
<h5 class="mb-2"><i class="fas fa-user-tie"></i> Managers</h5>
<h5 class="mb-2"><i class="fas fa-user-tie"></i> {{ _('Managers') }}</h5>
<div class="form-group">
<select name="manager_ids" id="edit-manager-select" class="form-select" multiple style="min-height: 100px; width: 100%;">
{% for manager in managers %}
<option value="{{ manager.id }}" class="manager-option">{{ manager.username }}</option>
{% endfor %}
</select>
<small class="form-text">Hold Ctrl/Cmd to select multiple. Only unassigned managers shown.</small>
<small class="form-text">{{ _('Hold Ctrl/Cmd to select multiple. Only unassigned managers shown.') }}</small>
</div>
<div class="form-actions">
<button type="button" class="btn btn-secondary" data-action="hide-edit-form">Cancel</button>
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="button" class="btn btn-secondary" data-action="hide-edit-form">{{ _('Cancel') }}</button>
<button type="submit" class="btn btn-primary">{{ _('Save Changes') }}</button>
</div>
</form>
</div>