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
+64 -66
View File
@@ -7,33 +7,33 @@
<div class="tryout-detail">
<div class="card mb-4">
<div class="card-header">
<h3>Tryout Details</h3>
<h3>{{ _('Tryout Details') }}</h3>
<div class="card-actions">
{% if can_edit and not tryout.is_ended %}
<a href="{{ url_for('matches.create_match', tryout_id=tryout.id) }}" class="btn btn-sm btn-success">
<i class="fas fa-futbol"></i> Schedule Match
<i class="fas fa-futbol"></i> {{ _('Schedule Match') }}
</a>
{% endif %}
{% if can_edit %}
<form method="POST" action="{{ url_for('tryouts.update_status', tryout_id=tryout.id) }}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="status" data-submit-on-change class="form-select">
<option value="upcoming" {% if tryout.status == 'upcoming' %}selected{% endif %}>Upcoming</option>
<option value="in_progress" {% if tryout.status == 'in_progress' %}selected{% endif %}>In Progress</option>
<option value="completed" {% if tryout.status == 'completed' %}selected{% endif %}>Completed</option>
<option value="upcoming" {% if tryout.status == 'upcoming' %}selected{% endif %}>{{ _('Upcoming') }}</option>
<option value="in_progress" {% if tryout.status == 'in_progress' %}selected{% endif %}>{{ _('In Progress') }}</option>
<option value="completed" {% if tryout.status == 'completed' %}selected{% endif %}>{{ _('Completed') }}</option>
</select>
</form>
{% endif %}
{% if can_edit and not tryout.is_ended %}
<a href="{{ url_for('tryouts.edit_tryout', tryout_id=tryout.id) }}" class="btn btn-sm btn-primary">
<i class="fas fa-edit"></i> Edit
<i class="fas fa-edit"></i> {{ _('Edit') }}
</a>
{% endif %}
{% if can_edit %}
<form method="POST" action="{{ url_for('tryouts.delete_tryout', tryout_id=tryout.id) }}" class="inline-form" data-confirm="{{ _('Delete this entire tryout? This removes all its matches, teams, registrations and evaluations.') }}">
<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 Tryout
<i class="fas fa-trash"></i> {{ _('Delete Tryout') }}
</button>
</form>
{% endif %}
@@ -105,7 +105,7 @@
<form method="POST" action="{{ url_for('tryouts.register_for_tryout', tryout_id=tryout.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-primary btn-lg">
<i class="fas fa-user-plus"></i> Register for this Tryout
<i class="fas fa-user-plus"></i> {{ _('Register for this Tryout') }}
</button>
</form>
</div>
@@ -115,20 +115,20 @@
{% if can_edit and not tryout.is_ended %}
<div class="card mb-4">
<div class="card-header">
<h3><i class="fas fa-user-plus"></i> Add Player to Tryout</h3>
<h3><i class="fas fa-user-plus"></i> {{ _('Add Player to Tryout') }}</h3>
</div>
<div class="card-body">
<form method="POST" action="{{ url_for('tryouts.register_player', tryout_id=tryout.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 %}
{% set is_already = registrations | selectattr('player_id', 'equalto', p.id) | list | length > 0 %}
<option value="{{ p.id }}" {% if is_already %}disabled class="text-muted"{% endif %}>{{ p.username }}{% if is_already %} (already registered){% endif %}</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-sm btn-primary ml-2">
<i class="fas fa-plus"></i> Register Player
<i class="fas fa-plus"></i> {{ _('Register Player') }}
</button>
</form>
</div>
@@ -145,13 +145,13 @@
<table class="table">
<thead>
<tr>
<th>Player</th>
<th>Status</th>
<th>{{ _('Player') }}</th>
<th>{{ _('Status') }}</th>
{% if current_user.can_evaluate() %}
<th>Evaluation</th>
<th>{{ _('Evaluation') }}</th>
{% endif %}
{% if can_edit %}
<th>Actions</th>
<th>{{ _('Actions') }}</th>
{% endif %}
</tr>
</thead>
@@ -170,9 +170,9 @@
<form method="POST" action="{{ url_for('tryouts.update_registration_status', tryout_id=tryout.id, player_id=p.id) }}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="status" data-submit-on-change class="form-select form-select-sm">
<option value="registered" {% if reg.status == 'registered' %}selected{% endif %}>Registered</option>
<option value="attended" {% if reg.status == 'attended' %}selected{% endif %}>Attended</option>
<option value="no_show" {% if reg.status == 'no_show' %}selected{% endif %}>No Show</option>
<option value="registered" {% if reg.status == 'registered' %}selected{% endif %}>{{ _('Registered') }}</option>
<option value="attended" {% if reg.status == 'attended' %}selected{% endif %}>{{ _('Attended') }}</option>
<option value="no_show" {% if reg.status == 'no_show' %}selected{% endif %}>{{ _('No Show') }}</option>
</select>
</form>
{% else %}
@@ -191,7 +191,7 @@
{% if can_edit %}
<td class="eval-actions">
{% if current_user.can_evaluate() %}
<a href="{{ url_for('evaluations.evaluate_player', tryout_id=tryout.id, player_id=p.id) }}" class="btn btn-sm btn-primary" title="Evaluate player">
<a href="{{ url_for('evaluations.evaluate_player', tryout_id=tryout.id, player_id=p.id) }}" class="btn btn-sm btn-primary" title="{{ _('Evaluate player') }}">
<i class="fas fa-edit"></i> {% if player_eval_status.get(p.id) %}Edit{% else %}Evaluate{% endif %}
</a>
<a href="{{ url_for('users.add_note_from_tryout', tryout_id=tryout.id) }}?player_id={{ p.id }}" class="btn btn-sm btn-outline" title="Add note for {{ p.username }}">
@@ -201,8 +201,8 @@
{% if not tryout.is_ended %}
<form method="POST" action="{{ url_for('tryouts.remove_player', tryout_id=tryout.id, player_id=p.id) }}" class="inline-form" data-confirm="{{ _('Remove %(name)s from this tryout? They will also be removed from every team and match within it.', name=p.username) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-sm btn-danger" title="Remove player from tryout">
<i class="fas fa-user-minus"></i> Remove
<button type="submit" class="btn btn-sm btn-danger" title="{{ _('Remove player from tryout') }}">
<i class="fas fa-user-minus"></i> {{ _('Remove') }}
</button>
</form>
{% endif %}
@@ -211,9 +211,7 @@
</tr>
{% else %}
<tr>
<td colspan="{% if can_edit %}{% if current_user.can_evaluate() %}5{% else %}4{% endif %}{% else %}{% if current_user.can_evaluate() %}4{% else %}2{% endif %}{% endif %}" class="text-center">
No players registered yet.
</td>
<td colspan="{% if can_edit %}{% if current_user.can_evaluate() %}5{% else %}4{% endif %}{% else %}{% if current_user.can_evaluate() %}4{% else %}2{% endif %}{% endif %}" class="text-center">{{ _('No players registered yet.') }}</td>
</tr>
{% endfor %}
</tbody>
@@ -224,10 +222,10 @@
<div class="card">
<div class="card-header">
<h3><i class="fas fa-users-cog"></i> Teams</h3>
<h3><i class="fas fa-users-cog"></i> {{ _('Teams') }}</h3>
{% if can_edit and not tryout.is_ended %}
<button class="btn btn-sm btn-primary" data-action="show-create-team">
<i class="fas fa-plus"></i> New Team
<i class="fas fa-plus"></i> {{ _('New Team') }}
</button>
{% endif %}
</div>
@@ -236,9 +234,9 @@
<div id="createTeamForm" class="hidden mb-3">
<form method="POST" action="{{ url_for('tryouts.create_team', tryout_id=tryout.id) }}" class="form-inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input type="text" name="team_name" placeholder="Team name" required class="form-input mr-2">
<button type="submit" class="btn btn-sm btn-success">Create</button>
<button type="button" class="btn btn-sm btn-secondary" data-action="hide-create-team">Cancel</button>
<input type="text" name="team_name" placeholder="{{ _('Team name') }}" required class="form-input mr-2">
<button type="submit" class="btn btn-sm btn-success">{{ _('Create') }}</button>
<button type="button" class="btn btn-sm btn-secondary" data-action="hide-create-team">{{ _('Cancel') }}</button>
</form>
</div>
{% endif %}
@@ -256,7 +254,7 @@
{% endif %}
</li>
{% else %}
<li class="text-muted">No players assigned yet.</li>
<li class="text-muted">{{ _('No players assigned yet.') }}</li>
{% endfor %}
</ul>
{% if can_edit and not tryout.is_ended and registered_players %}
@@ -264,7 +262,7 @@
<form method="POST" action="{{ url_for('tryouts.add_to_team', tryout_id=tryout.id, team_id=team.team.id) }}" class="form-inline mt-2">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="player_id" class="form-select" required>
<option value="">Select player...</option>
<option value="">{{ _('Select player...') }}</option>
{% for p in registered_players %}
{% if p.id not in team.members | map(attribute='player') | map(attribute='id') | list %}
<option value="{{ p.id }}">{{ p.username }}</option>
@@ -273,20 +271,20 @@
</select>
{% if positions %}
<select name="position" class="form-select mx-2">
<option value="">-- Select Position --</option>
<option value="">{{ _('-- Select Position --') }}</option>
{% for pos in positions %}
<option value="{{ pos }}">{{ pos }}</option>
{% endfor %}
</select>
{% else %}
<input type="text" name="position" placeholder="Position" class="form-input mx-2">
<input type="text" name="position" placeholder="{{ _('Position') }}" class="form-input mx-2">
{% endif %}
<button type="submit" class="btn btn-sm btn-primary">Add</button>
<button type="submit" class="btn btn-sm btn-primary">{{ _('Add') }}</button>
</form>
{% endif %}
</div>
{% else %}
<p class="text-muted text-center">No teams created yet.</p>
<p class="text-muted text-center">{{ _('No teams created yet.') }}</p>
{% endfor %}
</div>
</div>
@@ -295,14 +293,14 @@
{% if can_view_calendar %}
<div class="card tryout-schedule-card mb-4">
<div class="card-header">
<h3><i class="fas fa-futbol"></i> Schedule</h3>
<h3><i class="fas fa-futbol"></i> {{ _('Schedule') }}</h3>
{% if can_edit and not tryout.is_ended %}
<div class="card-actions">
<a href="{{ url_for('matches.create_match', tryout_id=tryout.id) }}" class="btn btn-sm btn-success">
<i class="fas fa-plus"></i> Schedule Match
<i class="fas fa-plus"></i> {{ _('Schedule Match') }}
</a>
<a href="{{ url_for('users.add_note_from_tryout', tryout_id=tryout.id) }}" class="btn btn-sm btn-primary">
<i class="fas fa-sticky-note"></i> Add Note
<i class="fas fa-sticky-note"></i> {{ _('Add Note') }}
</a>
</div>
{% endif %}
@@ -314,15 +312,15 @@
<table class="table">
<thead>
<tr>
<th>Match</th>
<th>Type</th>
<th>Date</th>
<th>Participants</th>
<th>Time</th>
<th>Presence</th>
<th>Status</th>
<th>{{ _('Match') }}</th>
<th>{{ _('Type') }}</th>
<th>{{ _('Date') }}</th>
<th>{{ _('Participants') }}</th>
<th>{{ _('Time') }}</th>
<th>{{ _('Presence') }}</th>
<th>{{ _('Status') }}</th>
{% if can_edit %}
<th>Actions</th>
<th>{{ _('Actions') }}</th>
{% endif %}
</tr>
</thead>
@@ -380,7 +378,7 @@
{% if pp.player_id == current_user.id %}
<div class="presence-players" style="margin-top:6px;">
<button class="btn btn-xs presence-toggle-btn {% if pp.attendance_confirmed %}presence-confirmed-btn{% else %}presence-pending-btn{% endif %}"
title="Toggle your attendance"
title="{{ _('Toggle your attendance') }}"
data-action="toggle-tryout-presence" data-match-id="{{ m.id }}" data-participant-id="{{ pp.participant_id }}">
Me {% if pp.attendance_confirmed %}✅{% else %}⏳{% endif %}
</button>
@@ -452,11 +450,11 @@
<td>
{% if not tryout.is_ended %}
<a href="{{ url_for('matches.edit_match', match_id=m.id) }}" class="btn btn-sm btn-outline">
<i class="fas fa-edit"></i> Edit
<i class="fas fa-edit"></i> {{ _('Edit') }}
</a>
{% endif %}
<a href="{{ url_for('users.add_note_from_match', match_id=m.id) }}" class="btn btn-sm btn-primary" title="Add Note for this Match">
<i class="fas fa-sticky-note"></i> Note
<a href="{{ url_for('users.add_note_from_match', match_id=m.id) }}" class="btn btn-sm btn-primary" title="{{ _('Add Note for this Match') }}">
<i class="fas fa-sticky-note"></i> {{ _('Note') }}
</a>
</td>
{% endif %}
@@ -474,7 +472,7 @@
<!-- No matches yet - show message -->
<div class="text-center py-4">
<i class="fas fa-calendar-alt fa-3x text-muted mb-3"></i>
<p class="text-muted">No matches scheduled yet. Check back later!</p>
<p class="text-muted">{{ _('No matches scheduled yet. Check back later!') }}</p>
</div>
{% endif %}
</div>
@@ -484,26 +482,26 @@
{% if current_user.can_evaluate() %}
<div class="card">
<div class="card-header">
<h3><i class="fas fa-star"></i> Evaluation Summary</h3>
<h3><i class="fas fa-star"></i> {{ _('Evaluation Summary') }}</h3>
</div>
<div class="card-body">
<div class="table-container">
<table class="table">
<thead>
<tr>
<th>Player</th>
<th>Evaluator</th>
<th>Mecanics</th>
<th>Cohesion</th>
<th>Communication</th>
<th>Gamesense</th>
<th>Versatility</th>
<th>Discipline</th>
<th>Analysis</th>
<th>Sport Ethics</th>
<th>Mental</th>
<th>Overall</th>
<th>Recommendation</th>
<th>{{ _('Player') }}</th>
<th>{{ _('Evaluator') }}</th>
<th>{{ _('Mecanics') }}</th>
<th>{{ _('Cohesion') }}</th>
<th>{{ _('Communication') }}</th>
<th>{{ _('Gamesense') }}</th>
<th>{{ _('Versatility') }}</th>
<th>{{ _('Discipline') }}</th>
<th>{{ _('Analysis') }}</th>
<th>{{ _('Sport Ethics') }}</th>
<th>{{ _('Mental') }}</th>
<th>{{ _('Overall') }}</th>
<th>{{ _('Recommendation') }}</th>
</tr>
</thead>
<tbody>
@@ -525,7 +523,7 @@
</tr>
{% else %}
<tr>
<td colspan="13" class="text-center">No evaluations yet.</td>
<td colspan="13" class="text-center">{{ _('No evaluations yet.') }}</td>
</tr>
{% endfor %}
</tbody>