diff --git a/locales/en.json b/locales/en.json index 9e069aad7..cd7365f95 100644 --- a/locales/en.json +++ b/locales/en.json @@ -683,21 +683,21 @@ "port_already_closed": "Port {port} is already closed for {ip_version} connections", "port_already_opened": "Port {port} is already opened for {ip_version} connections", "postinstall_low_rootfsspace": "The root filesystem has a total space less than 10 GB, which is quite worrisome! You will likely run out of disk space very quickly! It's recommended to have at least 16GB for the root filesystem. If you want to install YunoHost despite this warning, re-run the postinstall with --force-diskspace", - "pydantic.type_error": "Invalid type.", - "pydantic.type_error.none.not_allowed": "Value is required.", - "pydantic.type_error.str": "Invalid type, string expected.", - "pydantic.value_error.color": "Not a valid color, value must be a named or hex color.", - "pydantic.value_error.const": "Unexpected value; choose between {permitted}", - "pydantic.value_error.date": "Invalid date format", - "pydantic.value_error.email": "Value is not a valid email address", - "pydantic.value_error.number.not_ge": "Value must be greater than or equal to {limit_value}.", - "pydantic.value_error.number.not_le": "Value must be less than or equal to {limit_value}.", - "pydantic.value_error.str.regex": "Invalid string; value doesn't respects the pattern '{pattern}'", - "pydantic.value_error.time": "Invalid time format", - "pydantic.value_error.url.extra": "URL invalid, extra characters found after valid URL: '{extra}'", - "pydantic.value_error.url.host": "URL host invalid", - "pydantic.value_error.url.port": "URL port invalid, port cannot exceed 65535", - "pydantic.value_error.url.scheme": "Invalid or missing URL scheme", + "pydantic_type_error": "Invalid type.", + "pydantic_type_error_none_not_allowed": "Value is required.", + "pydantic_type_error_str": "Invalid type, string expected.", + "pydantic_value_error_color": "Not a valid color, value must be a named or hex color.", + "pydantic_value_error_const": "Unexpected value; choose between {permitted}", + "pydantic_value_error_date": "Invalid date format", + "pydantic_value_error_email": "Value is not a valid email address", + "pydantic_value_error_number_not_ge": "Value must be greater than or equal to {limit_value}.", + "pydantic_value_error_number_not_le": "Value must be less than or equal to {limit_value}.", + "pydantic_value_error_str_regex": "Invalid string; value doesn't respects the pattern '{pattern}'", + "pydantic_value_error_time": "Invalid time format", + "pydantic_value_error_url_extra": "URL invalid, extra characters found after valid URL: '{extra}'", + "pydantic_value_error_url_host": "URL host invalid", + "pydantic_value_error_url_port": "URL port invalid, port cannot exceed 65535", + "pydantic_value_error_url_scheme": "Invalid or missing URL scheme", "regenconf_dry_pending_applying": "Checking pending configuration which would have been applied for category '{category}'...", "regenconf_failed": "Could not regenerate the configuration for category(s): {categories}", "regenconf_file_backed_up": "Configuration file '{conf}' backed up to '{backup}'", diff --git a/src/utils/form.py b/src/utils/form.py index 42681667d..4daf0fd10 100644 --- a/src/utils/form.py +++ b/src/utils/form.py @@ -2003,6 +2003,22 @@ def parse_prefilled_values( return values +# i18n: pydantic_type_error +# i18n: pydantic_type_error_none_not_allowed +# i18n: pydantic_type_error_str +# i18n: pydantic_value_error_color +# i18n: pydantic_value_error_const +# i18n: pydantic_value_error_date +# i18n: pydantic_value_error_email +# i18n: pydantic_value_error_number_not_ge +# i18n: pydantic_value_error_number_not_le +# i18n: pydantic_value_error_str_regex +# i18n: pydantic_value_error_time +# i18n: pydantic_value_error_url_extra +# i18n: pydantic_value_error_url_host +# i18n: pydantic_value_error_url_port +# i18n: pydantic_value_error_url_scheme + MAX_RETRIES = 4 @@ -2099,7 +2115,9 @@ def prompt_or_validate_form( ): err_text = option.pattern.error else: - err_text = m18n.n(f"pydantic.{err['type']}", **ctx) + err_text = m18n.n( + f"pydantic.{err['type']}".replace(".", "_"), **ctx + ) else: err_text = str(e)