fix(i18n): prepare for Lokalise
This commit is contained in:
@@ -124,15 +124,32 @@ function PasswordValidation({
|
||||
function getErrorMessage(key: PasswordValidatorKey) {
|
||||
switch (key) {
|
||||
case "length":
|
||||
return `10 ${intl.formatMessage({ id: "to" })} 40 ${intl.formatMessage({ id: "characters" })}`
|
||||
return intl.formatMessage(
|
||||
{
|
||||
id: "{min} to {max} characters",
|
||||
},
|
||||
{
|
||||
min: 10,
|
||||
max: 40,
|
||||
}
|
||||
)
|
||||
case "hasUppercase":
|
||||
return `1 ${intl.formatMessage({ id: "uppercase letter" })}`
|
||||
return intl.formatMessage(
|
||||
{ id: "{count} uppercase letter" },
|
||||
{ count: 1 }
|
||||
)
|
||||
case "hasLowercase":
|
||||
return `1 ${intl.formatMessage({ id: "lowercase letter" })}`
|
||||
return intl.formatMessage(
|
||||
{ id: "{count} lowercase letter" },
|
||||
{ count: 1 }
|
||||
)
|
||||
case "hasNumber":
|
||||
return `1 ${intl.formatMessage({ id: "number" })}`
|
||||
return intl.formatMessage({ id: "{count} number" }, { count: 1 })
|
||||
case "hasSpecialChar":
|
||||
return `1 ${intl.formatMessage({ id: "special character" })}`
|
||||
return intl.formatMessage(
|
||||
{ id: "{count} special character" },
|
||||
{ count: 1 }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user