Bug #64827
note sur l’utilisation de f-strings pour les chaines à traduire : ne pas faire ça
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
04 mai 2022
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Je faisais la traduction et je vois qu'il y a maintenant des f-strings plein src/authentic2/journal_event_types.py; ça ne peut pas marcher, exemple :
def get_message(cls, event, context): days_of_inactivity = event.get_data('days_of_inactivity') email = event.get_data('email') return _( f'user deletion after {days_of_inactivity} days of inactivity, notification sent to "{email}".' )
- temps 1: la f-string fait son taf, la chaine devient "user deletion after 10 days of inactivity, notification envoyée à plop".
- temps 2: cette chaine est passée à gettext, qui ne la trouve pas dans son catalogue.
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a presque 2 ans
- Fichier 0001-misc-remove-usage-of-f-strings-for-translatable-stri.patch 0001-misc-remove-usage-of-f-strings-for-translatable-stri.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a presque 2 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a presque 2 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 4b4eac38d0fb36126fd8768e1fe12f0e84b0029d Author: Frédéric Péters <fpeters@entrouvert.com> Date: Wed May 4 08:20:50 2022 +0200 misc: remove usage of f-strings for translatable strings (#64827)
(et je vais taper une note pour la réunion lundi prochain être sûr que ça ait bien été vu).
Mis à jour par Transition automatique il y a presque 2 ans
- Statut changé de Résolu (à déployer) à Solution déployée
misc: remove usage of f-strings for translatable strings (#64827)