In keys with placegholders the remaining part after placeholders is not used to find the key, witch leads to unusable keys, like ensure that there are no more than {} digits in total
To Reproduce
from decimal import Decimal
from pydantic import BaseModel, Field
class T(BaseModel):
t: Decimal = Field(max_digits=3)
tr = PydanticI18n({"en_US": {"ensure that there are no more than {} digits in total": "something {} something"}})
try:
T(t="1111")
except Exception as e:
print(tr.translate(e.errors(), locale=tr.default_locale))
Expected result: something 3 something
Real result: ensure that there are no more than 3
Environment
OS: Windows & Linux
pydantic-i18n version: 0.4.0
Python version: 3.9.10
Additional Details
I think I figured out what is wrong, I will be submitting a PR to fix this soon
Description
In keys with placegholders the remaining part after placeholders is not used to find the key, witch leads to unusable keys, like
ensure that there are no more than {} digits in total
To Reproduce
Expected result:
something 3 something
Real result:ensure that there are no more than 3
Environment
Additional Details
I think I figured out what is wrong, I will be submitting a PR to fix this soon