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:
loki5512344 2026-09-28 13:35:29 +02:00
parent fd0fe59fee
commit 07b3f55bee
Signed by: boba
GPG key ID: 253067914055423B
5 changed files with 18 additions and 7 deletions

View file

@ -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