fix: better error message
This commit is contained in:
parent
27350dcab4
commit
0682613f94
4 changed files with 94 additions and 89 deletions
|
|
@ -5,8 +5,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"POT-Creation-Date: 2025-12-22 15:32+0100\n"
|
"POT-Creation-Date: 2025-12-22 19:02+0100\n"
|
||||||
"PO-Revision-Date: 2025-12-22 15:35+0100\n"
|
"PO-Revision-Date: 2025-12-22 19:04+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
|
@ -980,56 +980,50 @@ msgstr ""
|
||||||
"la famille {0} est {1}, {2} à l'index \"{3}\", elle a été chargée depuis {4}"
|
"la famille {0} est {1}, {2} à l'index \"{3}\", elle a été chargée depuis {4}"
|
||||||
|
|
||||||
#: src/rougail/user_data.py:421
|
#: src/rougail/user_data.py:421
|
||||||
msgid "variable is {0}, it has been loading from {1}"
|
msgid "variable has propery {0}, it has been loading from {1}"
|
||||||
msgstr "la variable est {0}, elle a été chargée depuis {1}"
|
msgstr "la variable a la propriété {0}, elle a été chargée depuis {1}"
|
||||||
|
|
||||||
#: src/rougail/user_data.py:425
|
#: src/rougail/user_data.py:425
|
||||||
msgid "variable is {0}, it will be ignored when loading from {1}"
|
msgid "variable has property {0}, it will be ignored when loading from {1}"
|
||||||
msgstr "la variable est {0}, elle sera ignorée lors du chargement depuis {1}"
|
msgstr ""
|
||||||
|
"la variable a la propriété {0}, elle sera ignorée lors du chargement depuis "
|
||||||
|
"{1}"
|
||||||
|
|
||||||
#: src/rougail/user_data.py:435
|
#: src/rougail/user_data.py:435
|
||||||
msgid ""
|
msgid ""
|
||||||
"family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
|
"family {0} has property {1}, so cannot access to {2}, it has been loading "
|
||||||
|
"from {3}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"la famille {0} est {1}, donc ne peut accéder à {2}, elle a été chargée "
|
"la famille {0} a la propriété {1}, donc ne peut accéder à {2}, elle a été "
|
||||||
"depuis {3}"
|
"chargée depuis {3}"
|
||||||
|
|
||||||
#: src/rougail/user_data.py:439
|
#: src/rougail/user_data.py:439
|
||||||
msgid ""
|
msgid ""
|
||||||
"family {0} is {1}, so cannot access to {2}, it will be ignored when loading "
|
"family {0} has property {1}, so cannot access to {2}, it will be ignored "
|
||||||
"from {3}"
|
"when loading from {3}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"la famille {0} est {1}, donc ne peut accéder à {2}, sera ignorée lors du "
|
"la famille {0} a la propriété {1}, donc ne peut accéder à {2}, sera ignorée "
|
||||||
"chargement depuis {3}"
|
"lors du chargement depuis {3}"
|
||||||
|
|
||||||
|
#: src/rougail/user_data.py:459
|
||||||
|
msgid "{0}, it has been loading from {1}"
|
||||||
|
msgstr "{0}, elle a été chargée depuis {1}"
|
||||||
|
|
||||||
#: src/rougail/user_data.py:461
|
#: src/rougail/user_data.py:461
|
||||||
msgid ""
|
msgid "{0}, it will be ignored when loading from {1}"
|
||||||
"the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has "
|
msgstr "{0}, elle sera ignorée lors du chargement depuis {1}"
|
||||||
"been loading from {5}"
|
|
||||||
msgstr ""
|
|
||||||
"la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, elle "
|
|
||||||
"a été chargée depuis {5}"
|
|
||||||
|
|
||||||
#: src/rougail/user_data.py:465
|
#: src/rougail/user_data.py:466
|
||||||
msgid ""
|
msgid "the value \"{0}\" is an invalid {1}, {2}"
|
||||||
"the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will "
|
msgstr "la valeur \"{0}\" est un {1} invalide, {2}"
|
||||||
"be ignored when loading from {5}"
|
|
||||||
msgstr ""
|
|
||||||
"la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, elle "
|
|
||||||
"sera ignorée lors du chargement depuis {5}"
|
|
||||||
|
|
||||||
#: src/rougail/user_data.py:481
|
#: src/rougail/user_data.py:472
|
||||||
msgid "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
|
msgid ", it has been loading from {0}"
|
||||||
msgstr ""
|
msgstr ", elle a été chargée depuis {0}"
|
||||||
"la valeur \"{0}\" est un {1} invalide pour {2}, elle a été chargée depuis {3}"
|
|
||||||
|
|
||||||
#: src/rougail/user_data.py:485
|
#: src/rougail/user_data.py:474
|
||||||
msgid ""
|
msgid ", it will be ignored when loading from {0}"
|
||||||
"the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading "
|
msgstr ", elle sera ignorée lors du chargement depuis {0}"
|
||||||
"from {3}"
|
|
||||||
msgstr ""
|
|
||||||
"la valeur \"{0}\" est un {1} invalide pour {2}, elle sera ignorée lors du "
|
|
||||||
"chargement depuis {3}"
|
|
||||||
|
|
||||||
#: src/rougail/utils.py:56
|
#: src/rougail/utils.py:56
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|
@ -1063,6 +1057,32 @@ msgstr "unique"
|
||||||
msgid "auto modified"
|
msgid "auto modified"
|
||||||
msgstr "auto modifiée"
|
msgstr "auto modifiée"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has "
|
||||||
|
#~ "been loading from {5}"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, "
|
||||||
|
#~ "elle a été chargée depuis {5}"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it "
|
||||||
|
#~ "will be ignored when loading from {5}"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "la valeur \"{0}\" est un {1} invalide pour {2} à l'index \"{3}\", {4}, "
|
||||||
|
#~ "elle sera ignorée lors du chargement depuis {5}"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "la valeur \"{0}\" est un {1} invalide, {2}, elle a été chargée depuis {3}"
|
||||||
|
|
||||||
|
#~ msgid ""
|
||||||
|
#~ "the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading "
|
||||||
|
#~ "from {3}"
|
||||||
|
#~ msgstr ""
|
||||||
|
#~ "la valeur \"{0}\" est un {1} invalide, {2}, elle sera ignorée lors du "
|
||||||
|
#~ "chargement depuis {3}"
|
||||||
|
|
||||||
#~ msgid "The secret pattern to build item name in Bitwarden"
|
#~ msgid "The secret pattern to build item name in Bitwarden"
|
||||||
#~ msgstr ""
|
#~ msgstr ""
|
||||||
#~ "Le patron de secret pour construire le nom de l'élément dans Bitwarden"
|
#~ "Le patron de secret pour construire le nom de l'élément dans Bitwarden"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2025-12-22 15:35+0100\n"
|
"POT-Creation-Date: 2025-12-22 19:04+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
@ -732,35 +732,39 @@ msgid "family {0} is {1}, {2} at index \"{3}\", it will be ignored when loading
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:421
|
#: src/rougail/user_data.py:421
|
||||||
msgid "variable is {0}, it has been loading from {1}"
|
msgid "variable has propery {0}, it has been loading from {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:425
|
#: src/rougail/user_data.py:425
|
||||||
msgid "variable is {0}, it will be ignored when loading from {1}"
|
msgid "variable has property {0}, it will be ignored when loading from {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:435
|
#: src/rougail/user_data.py:435
|
||||||
msgid "family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
|
msgid "family {0} has property {1}, so cannot access to {2}, it has been loading from {3}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:439
|
#: src/rougail/user_data.py:439
|
||||||
msgid "family {0} is {1}, so cannot access to {2}, it will be ignored when loading from {3}"
|
msgid "family {0} has property {1}, so cannot access to {2}, it will be ignored when loading from {3}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/rougail/user_data.py:459
|
||||||
|
msgid "{0}, it has been loading from {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:461
|
#: src/rougail/user_data.py:461
|
||||||
msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it has been loading from {5}"
|
msgid "{0}, it will be ignored when loading from {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:465
|
#: src/rougail/user_data.py:466
|
||||||
msgid "the value \"{0}\" is an invalid {1} for {2} at index \"{3}\", {4}, it will be ignored when loading from {5}"
|
msgid "the value \"{0}\" is an invalid {1}, {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:481
|
#: src/rougail/user_data.py:472
|
||||||
msgid "the value \"{0}\" is an invalid {1}, {2}, it has been loading from {3}"
|
msgid ", it has been loading from {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/user_data.py:485
|
#: src/rougail/user_data.py:474
|
||||||
msgid "the value \"{0}\" is an invalid {1}, {2}, it will be ignored when loading from {3}"
|
msgid ", it will be ignored when loading from {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/utils.py:56
|
#: src/rougail/utils.py:56
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -419,11 +419,11 @@ class UserData:
|
||||||
if path == err_path:
|
if path == err_path:
|
||||||
if self.invalid_user_data_error:
|
if self.invalid_user_data_error:
|
||||||
msg = _(
|
msg = _(
|
||||||
"variable is {0}, it has been loading from {1}"
|
"variable has propery {0}, it has been loading from {1}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
msg = _(
|
msg = _(
|
||||||
"variable is {0}, it will be ignored when loading from {1}"
|
"variable has property {0}, it will be ignored when loading from {1}"
|
||||||
)
|
)
|
||||||
self.unknowns.append({
|
self.unknowns.append({
|
||||||
msg.format(
|
msg.format(
|
||||||
|
|
@ -433,11 +433,11 @@ class UserData:
|
||||||
else:
|
else:
|
||||||
if self.invalid_user_data_error:
|
if self.invalid_user_data_error:
|
||||||
msg = _(
|
msg = _(
|
||||||
"family {0} is {1}, so cannot access to {2}, it has been loading from {3}"
|
"family {0} has property {1}, so cannot access to {2}, it has been loading from {3}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
msg = _(
|
msg = _(
|
||||||
"family {0} is {1}, so cannot access to {2}, it will be ignored when loading from {3}"
|
"family {0} has property {1}, so cannot access to {2}, it will be ignored when loading from {3}"
|
||||||
)
|
)
|
||||||
self.unknowns.append({
|
self.unknowns.append({
|
||||||
msg.format(
|
msg.format(
|
||||||
|
|
@ -453,46 +453,26 @@ class UserData:
|
||||||
)
|
)
|
||||||
except LeadershipError as err:
|
except LeadershipError as err:
|
||||||
self.unknowns.append({_("{0} in {1}").format(err, options["source"]): option._subconfig})
|
self.unknowns.append({_("{0} in {1}").format(err, options["source"]): option._subconfig})
|
||||||
|
except ConfigError as err:
|
||||||
|
err.prefix = ""
|
||||||
|
if self.invalid_user_data_error:
|
||||||
|
msg = _('{0}, it has been loading from {1}').format(err, options["source"])
|
||||||
|
else:
|
||||||
|
msg = _('{0}, it will be ignored when loading from {1}').format(err, options["source"])
|
||||||
|
self.invalids.append({msg: option._subconfig})
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
err.prefix = ""
|
err.prefix = ""
|
||||||
if index is not None:
|
|
||||||
type_ = option.type(translation=True)
|
type_ = option.type(translation=True)
|
||||||
if self.invalid_user_data_error:
|
msg = _('the value "{0}" is an invalid {1}, {2}').format(
|
||||||
msg = _(
|
|
||||||
'the value "{0}" is an invalid {1} for {2} at index "{3}", {4}, it has been loading from {5}'
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
msg = _(
|
|
||||||
'the value "{0}" is an invalid {1} for {2} at index "{3}", {4}, it will be ignored when loading from {5}'
|
|
||||||
)
|
|
||||||
self.invalids.append({
|
|
||||||
msg.format(
|
|
||||||
self._display_value(option, value),
|
|
||||||
type_,
|
|
||||||
option.description(with_quote=True),
|
|
||||||
index,
|
|
||||||
err,
|
|
||||||
options["source"],
|
|
||||||
): option._subconfig}
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
type_ = option.type(translation=True)
|
|
||||||
if self.invalid_user_data_error:
|
|
||||||
msg = _(
|
|
||||||
'the value "{0}" is an invalid {1}, {2}, it has been loading from {3}'
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
msg = _(
|
|
||||||
'the value "{0}" is an invalid {1}, {2}, it will be ignored when loading from {3}'
|
|
||||||
)
|
|
||||||
self.invalids.append({
|
|
||||||
msg.format(
|
|
||||||
self._display_value(option, value),
|
self._display_value(option, value),
|
||||||
type_,
|
type_,
|
||||||
err,
|
err,
|
||||||
options["source"],
|
|
||||||
): option._subconfig}
|
|
||||||
)
|
)
|
||||||
|
if self.invalid_user_data_error:
|
||||||
|
msg += _(', it has been loading from {0}').format(options["source"])
|
||||||
|
else:
|
||||||
|
msg += _(', it will be ignored when loading from {0}').format(options["source"])
|
||||||
|
self.invalids.append({msg: option._subconfig})
|
||||||
except AttributeOptionError as err:
|
except AttributeOptionError as err:
|
||||||
if err.code == "option-dynamic":
|
if err.code == "option-dynamic":
|
||||||
continue
|
continue
|
||||||
|
|
@ -504,6 +484,7 @@ class UserData:
|
||||||
# it's a function
|
# it's a function
|
||||||
params = tuple([ParamValue(val) for val in value[1:]])
|
params = tuple([ParamValue(val) for val in value[1:]])
|
||||||
value = Calculation(value[0], Params(params, kwargs={"option": ParamValue(option)}))
|
value = Calculation(value[0], Params(params, kwargs={"option": ParamValue(option)}))
|
||||||
|
option = self.config.forcepermissive.option(option.path(), option.index())
|
||||||
option.value.set(value)
|
option.value.set(value)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue