178 lines
9.1 KiB
Python
178 lines
9.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""Génère MSIN-4379-bib_v4-traductions.xlsx — brouillon traductions table info."""
|
|
from openpyxl import Workbook
|
|
from openpyxl.styles import Font, PatternFill, Alignment
|
|
from openpyxl.utils import get_column_letter
|
|
|
|
rows = [
|
|
("bib_v4_assign_title", "En-tête bloc assignation", "libellé",
|
|
"Assignation de dossard",
|
|
"Définissez les plages de numéros et assignez les dossards aux participants inscrits.",
|
|
"Bib assignment",
|
|
"Define bib ranges and assign numbers to registered participants.",
|
|
"info_texte max 50 car."),
|
|
("bib_v4_gestion_title", "En-tête bloc gestion (masqué phase 2)", "libellé",
|
|
"Gestion de l'épreuve",
|
|
"Bloc réservé à la gestion des quantités et paramètres — à venir.",
|
|
"Event management",
|
|
"Reserved for quantities and settings — coming soon.",
|
|
"Phase 2 — masqué pour l'instant"),
|
|
("bib_v4_gestion_placeholder", "Contenu bloc gestion", "libellé",
|
|
"Quantités et paramètres — à venir.",
|
|
"",
|
|
"Quantities and settings — coming soon.",
|
|
"",
|
|
""),
|
|
("bib_v4_col_start", "Colonne tableau séquences", "colonne",
|
|
"Début", "Premier numéro de la plage.", "Start", "First number in the range.", "aide optionnelle"),
|
|
("bib_v4_col_end", "Colonne tableau séquences", "colonne",
|
|
"Fin", "Dernier numéro de la plage.", "End", "Last number in the range.", ""),
|
|
("bib_v4_col_ok", "Colonne tableau séquences", "colonne",
|
|
"OK", "Enregistrer cette plage.", "OK", "Save this range.", ""),
|
|
("bib_v4_col_del", "Colonne tableau séquences", "colonne",
|
|
"Suppr.", "Supprimer la plage.", "Del.", "Delete this range.", ""),
|
|
("bib_v4_col_last", "Colonne tableau séquences", "colonne",
|
|
"Dernier", "Dernier dossard assigné dans la plage.", "Last", "Last bib assigned in the range.", ""),
|
|
("bib_v4_col_used", "Colonne tableau séquences", "colonne",
|
|
"Utilisé", "Nombre de dossards déjà assignés.", "Used", "Number of bibs already assigned.", ""),
|
|
("bib_v4_col_avail", "Colonne tableau séquences", "colonne",
|
|
"Dispo", "Dossards encore disponibles dans la plage.", "Avail.", "Bibs still available in the range.", ""),
|
|
("bib_v4_add", "Bouton + ajouter séquence", "libellé + ?",
|
|
"+ Ajouter",
|
|
"Ajoute une nouvelle plage de dossards pour cette épreuve.\n\nIndiquez le numéro de début et de fin, puis cliquez OK.",
|
|
"+ Add",
|
|
"Adds a new bib range for this race.\n\nEnter start and end numbers, then click OK.",
|
|
"Libellé bouton ; aide = pop-up ?"),
|
|
("bib_v4_tip_add", "Survol bouton +", "tip",
|
|
"Ajouter une plage de dossards", "", "Add a bib range", "", "info_texte seulement — pas de ?"),
|
|
("bib_v4_assign_seq", "Bouton assignation batch", "libellé + ?",
|
|
"Assigner par séquence",
|
|
"Mode batch : choisissez une ou plusieurs plages et l'ordre d'assignation, puis GO pour assigner tous les participants sans dossard.\n\nUtilisez Simuler pour prévisualiser sans modifier la base.",
|
|
"Assign by range",
|
|
"Batch mode: select one or more ranges and the assignment order, then GO to assign all participants without a bib.\n\nUse Simulate to preview without saving.",
|
|
""),
|
|
("bib_v4_assign_seq_cancel", "Libellé JS annuler batch", "libellé",
|
|
"Annuler", "", "Cancel", "", "data-batch-label-cancel"),
|
|
("bib_v4_tip_assign_seq", "Survol bouton batch", "tip",
|
|
"Assignation groupée par plages", "", "Batch assign by ranges", "", ""),
|
|
("bib_v4_reset", "Bouton réinitialiser", "libellé + ?",
|
|
"Réinitialiser",
|
|
"Retire les dossards déjà assignés pour les plages sélectionnées.\n\nAttention : vérifiez l'impact avant de confirmer.",
|
|
"Reset",
|
|
"Removes assigned bibs for the selected ranges.\n\nWarning: check the impact before confirming.",
|
|
""),
|
|
("bib_v4_tip_reset", "Survol bouton reset", "tip",
|
|
"Retirer les dossards assignés", "", "Remove assigned bibs", "", ""),
|
|
("bib_v4_auto", "Bouton auto (inactif)", "libellé + ?",
|
|
"Assignation automatique",
|
|
"Active l'assignation automatique à chaque nouvelle inscription dans les plages choisies.",
|
|
"Automatic assignment",
|
|
"Automatically assigns a bib on each new registration using the selected ranges.",
|
|
"Même info_aide que auto_config"),
|
|
("bib_v4_auto_config", "Bouton auto (actif)", "libellé",
|
|
"Auto — configurer",
|
|
"Modifie les plages utilisées pour l'assignation automatique.",
|
|
"Auto — configure",
|
|
"Change the ranges used for automatic assignment.",
|
|
"Libellé quand auto déjà actif"),
|
|
("bib_v4_tip_auto", "Survol bouton auto", "tip",
|
|
"Dossard assigné automatiquement à l'inscription", "", "Auto-assign bib on registration", "", ""),
|
|
("bib_v4_auto_badge", "Badge « auto actif »", "libellé + ?",
|
|
"Auto actif", "L'assignation automatique est activée pour cette épreuve.",
|
|
"Auto on", "Automatic assignment is enabled for this race.", ""),
|
|
("bib_v4_auto_select_hint", "Texte mode édition auto", "libellé + ?",
|
|
"Sélectionnez au moins une séquence.",
|
|
"Cochez les plages à utiliser pour l'assignation auto, puis cliquez Accepter.",
|
|
"Select at least one range.",
|
|
"Check the ranges to use for auto assignment, then click Accept.",
|
|
"Message dynamique JS si sélection"),
|
|
("bib_v4_auto_accept", "Bouton accepter auto", "libellé + ?",
|
|
"Accepter", "Enregistre la configuration d'assignation automatique.",
|
|
"Accept", "Saves the automatic assignment configuration.", ""),
|
|
("bib_v4_auto_cancel", "Bouton annuler auto", "libellé + ?",
|
|
"Annuler", "Quitte le mode édition sans enregistrer.",
|
|
"Cancel", "Exits edit mode without saving.", ""),
|
|
("bib_v4_auto_disable", "Bouton désactiver auto", "libellé + ?",
|
|
"Désactiver l'auto",
|
|
"Désactive l'assignation automatique. Les plages de dossards restent en place.",
|
|
"Disable auto",
|
|
"Disables automatic assignment. Bib ranges are kept.", ""),
|
|
("bib_v4_batch_order", "Label ordre batch", "libellé + ?",
|
|
"Ordre d'assignation",
|
|
"Critère pour trier les participants avant d'attribuer les dossards (nom, date d'inscription, équipe, etc.).",
|
|
"Assignment order",
|
|
"Sort order for participants before assigning bibs (name, registration date, team, etc.).", ""),
|
|
("bib_v4_batch_info", "Texte info batch", "libellé + ?",
|
|
"Sélectionnez les plages puis GO.",
|
|
"Le résumé (disponibles / à assigner / manquants) s'affiche ici après simulation ou GO.",
|
|
"Select ranges then click GO.",
|
|
"Summary (available / to assign / missing) appears here after simulate or GO.",
|
|
"Texte initial ; message dynamique en JS"),
|
|
("bib_v4_batch_simulate", "Bouton simuler batch", "libellé + ?",
|
|
"Simuler", "Affiche qui recevrait quel dossard sans modifier la base de données.",
|
|
"Simulate", "Shows who would receive which bib without changing the database.", ""),
|
|
("bib_v4_batch_go", "Bouton GO batch", "libellé + ?",
|
|
"GO", "Lance l'assignation batch pour de vrai.",
|
|
"GO", "Runs the batch assignment for real.", ""),
|
|
]
|
|
|
|
headers = [
|
|
"info_clef", "zone_ecran", "type", "info_prg",
|
|
"info_texte_fr", "info_aide_fr", "info_texte_en", "info_aide_en",
|
|
"statut", "notes",
|
|
]
|
|
|
|
wb = Workbook()
|
|
ws = wb.active
|
|
ws.title = "bib_v4_traductions"
|
|
|
|
header_fill = PatternFill("solid", fgColor="4472C4")
|
|
header_font = Font(bold=True, color="FFFFFF")
|
|
|
|
for col, h in enumerate(headers, 1):
|
|
cell = ws.cell(row=1, column=col, value=h)
|
|
cell.fill = header_fill
|
|
cell.font = header_font
|
|
cell.alignment = Alignment(horizontal="center", vertical="center", wrap_text=True)
|
|
|
|
for r, row in enumerate(rows, 2):
|
|
ws.cell(row=r, column=1, value=row[0])
|
|
ws.cell(row=r, column=2, value=row[1])
|
|
ws.cell(row=r, column=3, value=row[2])
|
|
ws.cell(row=r, column=4, value="compte.php")
|
|
ws.cell(row=r, column=5, value=row[3])
|
|
ws.cell(row=r, column=6, value=row[4])
|
|
ws.cell(row=r, column=7, value=row[5])
|
|
ws.cell(row=r, column=8, value=row[6])
|
|
ws.cell(row=r, column=9, value="à corriger")
|
|
ws.cell(row=r, column=10, value=row[7])
|
|
for c in (5, 6, 7, 8, 10):
|
|
ws.cell(row=r, column=c).alignment = Alignment(wrap_text=True, vertical="top")
|
|
|
|
widths = [28, 32, 14, 14, 28, 48, 28, 48, 12, 36]
|
|
for i, w in enumerate(widths, 1):
|
|
ws.column_dimensions[get_column_letter(i)].width = w
|
|
|
|
ws.freeze_panes = "A2"
|
|
|
|
ws2 = wb.create_sheet("README")
|
|
readme = [
|
|
"MSIN-4379 — Traductions écran dossards v4",
|
|
"",
|
|
"1. Éditez info_texte_fr/en (libellé visible, max ~50 car.) et info_aide_fr/en (pop-up ?).",
|
|
"2. Les clés bib_v4_tip_* : info_texte seulement (survol court), pas d'info_aide.",
|
|
"3. info_prg = compte.php pour toutes les entrées.",
|
|
"4. Mettez statut = OK quand une ligne est validée.",
|
|
"5. Renvoyez le fichier ; un script SQL INSERT sera généré (fr + en par clé).",
|
|
"",
|
|
"Avant import SQL :",
|
|
"DELETE FROM info WHERE info_clef LIKE 'bib_v4_%' AND info_prg IN ('compte.php','ajax_bib_range.php');",
|
|
]
|
|
for i, line in enumerate(readme, 1):
|
|
ws2.cell(row=i, column=1, value=line)
|
|
|
|
out = r"c:\dev_v4\ms1inscription4\MSIN-4379-bib_v4-traductions.xlsx"
|
|
wb.save(out)
|
|
print("Created:", out)
|
|
print("Rows:", len(rows))
|