fix(frontend): localize avatar validation errors
checkAvatarFile returned hard-coded Russian strings, so an English user picking a bad file got "Подойдёт PNG, JPG или WebP." with no translation. Route both messages through the account namespace (validation.avatarType / avatarTooBig) the same way the auth validators take a t function, keeping ru/en key parity enforced by the satisfies clause.
This commit is contained in:
parent
fd0fe59fee
commit
07b3f55bee
5 changed files with 18 additions and 7 deletions
|
|
@ -19,7 +19,7 @@ export function AvatarUpload() {
|
|||
const file = e.target.files?.[0]
|
||||
e.target.value = ''
|
||||
if (!file) return
|
||||
const problem = checkAvatarFile(file)
|
||||
const problem = checkAvatarFile(file, t)
|
||||
if (problem) {
|
||||
setError(problem)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue