Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

🤖 Fix localized delete confirmations (#1230)

Rayhan Sayed35913d4dc581
diff --git a/frontend/src/components/routes/event/Settings/Sections/DangerZoneSettings/index.tsx b/frontend/src/components/routes/event/Settings/Sections/DangerZoneSettings/index.tsx
index 7344a6885..3a36d6ee8 100644
--- a/frontend/src/components/routes/event/Settings/Sections/DangerZoneSettings/index.tsx
+++ b/frontend/src/components/routes/event/Settings/Sections/DangerZoneSettings/index.tsx
@@ -25,7 +25,8 @@ export const DangerZoneSettings = () => {
const [deleteConfirmation, setDeleteConfirmation] = useState('');
const isArchived = event?.status === EventStatus.ARCHIVED;
- const isDeleteConfirmed = deleteConfirmation.toLowerCase() === 'delete';
+ const deleteConfirmationPhrase = t`delete`;
+ const isDeleteConfirmed = deleteConfirmation.trim().toLocaleLowerCase() === deleteConfirmationPhrase.toLocaleLowerCase();
const handleDelete = () => {
const organizerId = event?.organizer?.id;
@@ -98,7 +99,7 @@ export const DangerZoneSettings = () => {
{t`Type "delete" to confirm`}
</Text>
<TextInput
- placeholder={t`delete`}
+ placeholder={deleteConfirmationPhrase}
value={deleteConfirmation}
onChange={(e) => setDeleteConfirmation(e.currentTarget.value)}
/>
diff --git a/frontend/src/components/routes/organizer/Settings/Sections/DangerZoneSettings/index.tsx b/frontend/src/components/routes/organizer/Settings/Sections/DangerZoneSettings/index.tsx
index 6d6a76842..945e0e94d 100644
--- a/frontend/src/components/routes/organizer/Settings/Sections/DangerZoneSettings/index.tsx
+++ b/frontend/src/components/routes/organizer/Settings/Sections/DangerZoneSettings/index.tsx
@@ -27,7 +27,8 @@ export const DangerZoneSettings = () => {
const [deleteConfirmation, setDeleteConfirmation] = useState('');
const isArchived = organizer?.status === OrganizerStatus.ARCHIVED;
- const isDeleteConfirmed = deleteConfirmation.toLowerCase() === 'delete';
+ const deleteConfirmationPhrase = t`delete`;
+ const isDeleteConfirmed = deleteConfirmation.trim().toLocaleLowerCase() === deleteConfirmationPhrase.toLocaleLowerCase();
const activeOrganizerCount = organizers?.data?.filter(
org => org.status !== OrganizerStatus.ARCHIVED
@@ -104,7 +105,7 @@ export const DangerZoneSettings = () => {
{t`Type "delete" to confirm`}
</Text>
<TextInput
- placeholder={t`delete`}
+ placeholder={deleteConfirmationPhrase}
value={deleteConfirmation}
onChange={(e) => setDeleteConfirmation(e.currentTarget.value)}
/>