diff --git a/web/public/locales/en/views/settings.json b/web/public/locales/en/views/settings.json index 16290ea80..8a64533b3 100644 --- a/web/public/locales/en/views/settings.json +++ b/web/public/locales/en/views/settings.json @@ -385,7 +385,8 @@ "mustNotBeSameWithCamera": "Zone name must not be the same as camera name.", "alreadyExists": "A zone with this name already exists for this camera.", "mustNotContainPeriod": "Zone name must not contain periods.", - "hasIllegalCharacter": "Zone name contains illegal characters." + "hasIllegalCharacter": "Zone name contains illegal characters.", + "mustHaveAtLeastOneLetter": "Zone name must have at least one letter." } }, "distance": { @@ -443,7 +444,7 @@ "name": { "title": "Name", "inputPlaceHolder": "Enter a name…", - "tips": "Name must be at least 2 characters and must not be the name of a camera or another zone." + "tips": "Name must be at least 2 characters, must have at least one letter, and must not be the name of a camera or another zone." }, "inertia": { "title": "Inertia", diff --git a/web/src/components/settings/ZoneEditPane.tsx b/web/src/components/settings/ZoneEditPane.tsx index 67f5f690a..8a1e36a0e 100644 --- a/web/src/components/settings/ZoneEditPane.tsx +++ b/web/src/components/settings/ZoneEditPane.tsx @@ -149,6 +149,11 @@ export default function ZoneEditPane({ ) .refine((value: string) => /^[a-zA-Z0-9_-]+$/.test(value), { message: t("masksAndZones.form.zoneName.error.hasIllegalCharacter"), + }) + .refine((value: string) => /[a-zA-Z]/.test(value), { + message: t( + "masksAndZones.form.zoneName.error.mustHaveAtLeastOneLetter", + ), }), inertia: z.coerce .number()