i18n: localize toasts

This commit is contained in:
Xylight committed 2024-06-04 13:02:05 -07:00
1 parent b57baa3769
commit e89d2aaddb
35 files changed
+169 -177

No files matched your search

@@ -51,9 +51,9 @@
registrationApplicationAnswer
)
toast({
content: `Successfully ${
approve ? 'approved' : 'denied'
} that application.`,
content: approve
? $t('toast.approvedApplication')
: $t('toast.deniedApplication'),
type: 'success',
})
application.creator_local_user.accepted_application = approve
+1 -1
View File
@@ -31,7 +31,7 @@
...formData,
})
toast({
content: 'Updated your site.',
content: $t('toast.updatedSite'),
type: 'success',
})
} catch (err) {
+4 -5
View File
@@ -109,7 +109,7 @@
if (res) {
toast({
content: 'Edited your site.',
content: $t('toast.updatedSite'),
type: 'success',
})
}
@@ -127,8 +127,7 @@
if (!data.federated_instances?.federated_instances?.blocked)
throw new Error('Missing instance')
const content = e.target?.result
if (!content)
toast({ content: 'No content in that file', type: 'warning' })
if (!content) toast({ content: $t('toast.failCSV'), type: 'warning' })
try {
const instances: Instance[] = []
@@ -152,12 +151,12 @@
data.federated_instances.federated_instances.blocked = instances
} catch (err) {
toast({ content: err as 'Failed to parse CSV', type: 'error' })
toast({ content: $t('toast.failCSV'), type: 'error' })
}
}
reader.onerror = (e) =>
toast({ content: 'Failed to read file.', type: 'error' })
toast({ content: $t('toast.failCSV'), type: 'error' })
reader.readAsText(files[0])
}
+1 -1
View File
@@ -29,7 +29,7 @@
taglines: taglines,
})
toast({
content: 'Successfully saved taglines.',
content: $t('toast.updatedSite'),
type: 'success',
})
} catch (err) {
+2 -2
View File
@@ -21,7 +21,7 @@
async function removeAdmin(id: number, confirm: boolean): Promise<any> {
if (!confirm)
return toast({
content: 'Are you sure you want to remove that admin?',
content: $t('toast.removeAdminWarning'),
action: () => removeAdmin(id, true),
})
@@ -37,7 +37,7 @@
if (result) {
data.site!.admins = result.admins
toast({
content: 'Removed that admin.',
content: $t('toast.removeAdmin'),
type: 'success',
})
}