From 0bc1e24d389cda52d5f2bc5050ad12bcedf8de34 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 9 Apr 2025 09:01:48 +0200 Subject: [PATCH] fix: better error message --- locale/fr/LC_MESSAGES/rougail.po | 66 ++++++++++++------ locale/rougail.pot | 46 +++++++----- src/rougail/locale/fr/LC_MESSAGES/rougail.mo | Bin 13318 -> 13544 bytes src/rougail/user_datas.py | 26 ++++--- .../tiramisu/base.py | 17 +++++ .../tiramisu/no_namespace.py | 12 ++++ 6 files changed, 115 insertions(+), 52 deletions(-) create mode 100644 tests/dictionaries/60_0family_dynamic_upper_char/tiramisu/base.py create mode 100644 tests/dictionaries/60_0family_dynamic_upper_char/tiramisu/no_namespace.py diff --git a/locale/fr/LC_MESSAGES/rougail.po b/locale/fr/LC_MESSAGES/rougail.po index 65ef8b76c..d1e5acd8f 100644 --- a/locale/fr/LC_MESSAGES/rougail.po +++ b/locale/fr/LC_MESSAGES/rougail.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-04-03 20:44+0200\n" -"PO-Revision-Date: 2025-04-03 20:46+0200\n" +"POT-Creation-Date: 2025-04-09 08:23+0200\n" +"PO-Revision-Date: 2025-04-09 08:26+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -239,7 +239,7 @@ msgstr "" "définition invalide pour la définition des \"structures\" ({0}), aucun " "fichier de structure ne peut être chargé !" -#: src/rougail/error.py:67 +#: src/rougail/error.py:67 src/rougail/user_datas.py:251 msgid "{0} in {1}" msgstr "{0} dans {1}" @@ -273,7 +273,7 @@ msgstr "" #: src/rougail/object_model.py:229 msgid "cannot find variable \"{0}\" defined in \"{1}\" for \"{2}\"" -msgstr "ne peut trouve la variable \"{0}\" défini dans \"{1}\" pour \"{2}\"" +msgstr "ne peut trouver la variable \"{0}\" défini dans \"{1}\" pour \"{2}\"" #: src/rougail/object_model.py:232 msgid "variable \"{0}\" defined in \"{1}\" for \"{2}\" is a dynamic variable" @@ -303,7 +303,7 @@ msgstr "" "La variable \"{0}\" n'est pas trouvé pour l'attribut \"{1}\" dans la " "variable \"{2}\"" -#: src/rougail/object_model.py:533 +#: src/rougail/object_model.py:536 msgid "" "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" " "is multi but is inside a list" @@ -311,7 +311,7 @@ msgstr "" "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est " "multiple mais est dans une liste" -#: src/rougail/object_model.py:536 +#: src/rougail/object_model.py:539 msgid "" "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" " "is not multi but is not inside a list" @@ -319,11 +319,11 @@ msgstr "" "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" " "n'est pas multiple mais n'est pas dans une liste" -#: src/rougail/object_model.py:539 +#: src/rougail/object_model.py:542 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", it's a list" msgstr "la variable \"{0}\" a un attribut invalide \"{1}\", c'est une liste" -#: src/rougail/object_model.py:548 +#: src/rougail/object_model.py:550 msgid "" "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" " "is a multi" @@ -331,7 +331,7 @@ msgstr "" "la variable \"{0}\" a un attribut invalide \"{1}\", la variable \"{2}\" est " "multiple" -#: src/rougail/object_model.py:570 +#: src/rougail/object_model.py:572 msgid "" "\"{0}\" attribut shall not have an \"optional\" attribute for variable " "\"{1}\"" @@ -339,15 +339,15 @@ msgstr "" "l'attribut \"{0}\" ne devrait pas avoir d'attribut \"optional\" pour la " "variable \"{1}\"" -#: src/rougail/object_model.py:582 +#: src/rougail/object_model.py:584 msgid "" -"variable \"{0}\" has a default variable calculated with \"{1}\" which has " +"variable \"{0}\" has a default value calculated with \"{1}\" which has " "incompatible type" msgstr "" "la variable \"{0}\" a une valeur par défaut calculé a partir de \"{1}\" " "laquelle a un type incompatible" -#: src/rougail/object_model.py:618 +#: src/rougail/object_model.py:620 msgid "" "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for " "variable \"{1}\"" @@ -355,7 +355,7 @@ msgstr "" "\"when\" n'est pas autorisé avec le format en version 1.0 pour l'attribut " "\"{0}\" pour la variable \"{1}\"" -#: src/rougail/object_model.py:621 +#: src/rougail/object_model.py:623 msgid "" "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and " "\"when_not\" cannot set together" @@ -363,7 +363,7 @@ msgstr "" "la variable \"{0}\" a un attribut invalide \"{1}\", \"when\" et \"when_not\" " "ne peuvent pas être défini ensemble" -#: src/rougail/object_model.py:627 +#: src/rougail/object_model.py:629 msgid "" "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for " "variable \"{1}\"" @@ -371,7 +371,7 @@ msgstr "" "\"when_not\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\" pour " "la variable variable \"{1}\"" -#: src/rougail/object_model.py:680 +#: src/rougail/object_model.py:682 msgid "" "cannot find variable \"{0}\" for the information \"{1}\" when calculating " "\"{2}\"" @@ -379,18 +379,18 @@ msgstr "" "ne peut trouver la variable \"{0}\" pour l'information \"{1}\" lors du " "calcul de \"{2}\"" -#: src/rougail/object_model.py:683 +#: src/rougail/object_model.py:685 msgid "" "identifier not allowed for the information \"{0}\" when calculating \"{1}\"" msgstr "" "identifier n'est pas autorisé pour l'information \"{0}\" lors du calcul de " "\"{1}\"" -#: src/rougail/object_model.py:732 +#: src/rougail/object_model.py:734 msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\"" msgstr "\"when\" n'est pas autorisé au format 1.0 pour l'attribut \"{0}\"" -#: src/rougail/object_model.py:736 src/rougail/object_model.py:744 +#: src/rougail/object_model.py:738 src/rougail/object_model.py:746 msgid "" "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" " "cannot set together" @@ -398,7 +398,7 @@ msgstr "" "l'identifiant a un attribut invalide \"{0}\", \"when\" et \"when_not\" ne " "peuvent pas être défini ensemble" -#: src/rougail/object_model.py:766 +#: src/rougail/object_model.py:768 msgid "" "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\"" msgstr "" @@ -478,15 +478,26 @@ msgstr "" msgid "internal error, {0} is not a dynamic variable" msgstr "erreur interne, \"{0}\" n'est pas une variable dynamique" -#: src/rougail/user_datas.py:164 +#: src/rougail/user_datas.py:116 +msgid "" +"cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}" +msgstr "" +"ne peut charger la variable \"{0}\", l'identifiant \"{1}\" n'est pas valide " +"dans {2}" + +#: src/rougail/user_datas.py:171 msgid "the variable \"{0}\" contains secrets and should not be defined in {1}" msgstr "" "la variable \"{0}\" contient des secrets et ne devrait pas être défini dans " "{1}" -#: src/rougail/user_datas.py:227 -msgid "the option \"{0}\" is an option description" -msgstr "l'option \"{0}\" est une option description" +#: src/rougail/user_datas.py:234 +msgid "the variable \"{0}\" is a family in {1}" +msgstr "la variable \"{0}\" est une famille dans {1}" + +#: src/rougail/user_datas.py:249 +msgid "{0} loaded from {1}" +msgstr "{0} chargée depuis {1}" #: src/rougail/utils.py:55 msgid "" @@ -500,6 +511,15 @@ msgstr "" msgid "error in jinja \"{0}\" for the variable \"{1}\": {2}" msgstr "erreur dans Jinja \"{0}\" pour la variable \"{1}\": {2}" +#~ msgid "error in {0}: {1}" +#~ msgstr "erreur dans {0} : {1}" + +#~ msgid "cannot find variable \"{0}\" from {1}: {2}" +#~ msgstr "ne peut trouver la variable \"{0}\" depuis {1} : {2}" + +#~ msgid "the option \"{0}\" is an option description" +#~ msgstr "l'option \"{0}\" est une option description" + #~ msgid "Update dictionaries to newest Rougail format version" #~ msgstr "" #~ "Mettre à jour le fichier de structure vers la dernière version du format " diff --git a/locale/rougail.pot b/locale/rougail.pot index c5fc06b80..d0da22bc6 100644 --- a/locale/rougail.pot +++ b/locale/rougail.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-04-03 20:46+0200\n" +"POT-Creation-Date: 2025-04-09 08:26+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -187,7 +187,7 @@ msgstr "" msgid "invalid \"structural\" definition ({0}), we cannot load any structural file!" msgstr "" -#: src/rougail/error.py:67 +#: src/rougail/error.py:67 src/rougail/user_datas.py:251 msgid "{0} in {1}" msgstr "" @@ -231,59 +231,59 @@ msgstr "" msgid "Variable not found \"{0}\" for attribut \"{1}\" in variable \"{2}\"" msgstr "" -#: src/rougail/object_model.py:533 +#: src/rougail/object_model.py:536 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is multi but is inside a list" msgstr "" -#: src/rougail/object_model.py:536 +#: src/rougail/object_model.py:539 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is not multi but is not inside a list" msgstr "" -#: src/rougail/object_model.py:539 +#: src/rougail/object_model.py:542 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", it's a list" msgstr "" -#: src/rougail/object_model.py:548 +#: src/rougail/object_model.py:550 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", the variable \"{2}\" is a multi" msgstr "" -#: src/rougail/object_model.py:570 +#: src/rougail/object_model.py:572 msgid "\"{0}\" attribut shall not have an \"optional\" attribute for variable \"{1}\"" msgstr "" -#: src/rougail/object_model.py:582 +#: src/rougail/object_model.py:584 msgid "variable \"{0}\" has a default value calculated with \"{1}\" which has incompatible type" msgstr "" -#: src/rougail/object_model.py:618 +#: src/rougail/object_model.py:620 msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\"" msgstr "" -#: src/rougail/object_model.py:621 +#: src/rougail/object_model.py:623 msgid "the variable \"{0}\" has an invalid attribute \"{1}\", \"when\" and \"when_not\" cannot set together" msgstr "" -#: src/rougail/object_model.py:627 +#: src/rougail/object_model.py:629 msgid "\"when_not\" is not allowed in format version 1.0 for attribute \"{0}\" for variable \"{1}\"" msgstr "" -#: src/rougail/object_model.py:680 +#: src/rougail/object_model.py:682 msgid "cannot find variable \"{0}\" for the information \"{1}\" when calculating \"{2}\"" msgstr "" -#: src/rougail/object_model.py:683 +#: src/rougail/object_model.py:685 msgid "identifier not allowed for the information \"{0}\" when calculating \"{1}\"" msgstr "" -#: src/rougail/object_model.py:732 +#: src/rougail/object_model.py:734 msgid "\"when\" is not allowed in format version 1.0 for attribute \"{0}\"" msgstr "" -#: src/rougail/object_model.py:736 src/rougail/object_model.py:744 +#: src/rougail/object_model.py:738 src/rougail/object_model.py:746 msgid "the identifier has an invalid attribute \"{0}\", \"when\" and \"when_not\" cannot set together" msgstr "" -#: src/rougail/object_model.py:766 +#: src/rougail/object_model.py:768 msgid "the variable \"{0}\" is not a follower, so cannot have index type for \"{1}\"" msgstr "" @@ -343,12 +343,20 @@ msgstr "" msgid "internal error, {0} is not a dynamic variable" msgstr "" -#: src/rougail/user_datas.py:164 +#: src/rougail/user_datas.py:116 +msgid "cannot load variable path \"{0}\", the identifier \"{1}\" is not valid in {2}" +msgstr "" + +#: src/rougail/user_datas.py:171 msgid "the variable \"{0}\" contains secrets and should not be defined in {1}" msgstr "" -#: src/rougail/user_datas.py:227 -msgid "the option \"{0}\" is an option description" +#: src/rougail/user_datas.py:234 +msgid "the variable \"{0}\" is a family in {1}" +msgstr "" + +#: src/rougail/user_datas.py:249 +msgid "{0} loaded from {1}" msgstr "" #: src/rougail/utils.py:55 diff --git a/src/rougail/locale/fr/LC_MESSAGES/rougail.mo b/src/rougail/locale/fr/LC_MESSAGES/rougail.mo index 7ba40306f623743ddd76618e7e515a5e2d11afa0..84a5fd03fee0accfe7b29f292ca076f0e6022bb2 100644 GIT binary patch delta 2112 zcmYM!e@xV69Ki7pKkkkn$^oHLC-DVQOgTAzqhLoW=1;`iM=kq+z z=gWn`U;N`gWG7z|N+)$KbtzF~9Ix2;paYp*{v_t& z8(538n2&!U6G`R@ks^E&AIDxS*QLHdV+|Ls;dY$IN=#oFTVVt0059PYoW&}1X2f=; z5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