Skip to content

Commit e11e859

Browse files
committed
fix: add notification messages
1 parent 2357a94 commit e11e859

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

app/utils/notification.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,44 @@ interface NotificationOptions {
22
content: string
33
}
44
export function notifyError(options: NotificationOptions) {
5+
const { t } = useI18n()
56
const toast = useToast()
67

78
toast.add({
8-
title: 'Error',
9+
title: t('Error'),
910
description: options.content,
1011
color: 'error',
1112
})
1213
}
1314

1415
export function notifySuccess(options: NotificationOptions) {
16+
const { t } = useI18n()
1517
const toast = useToast()
1618

1719
toast.add({
18-
title: 'Success',
20+
title: t('Success'),
1921
description: options.content,
2022
color: 'success',
2123
})
2224
}
2325

2426
export function notifyWarning(options: NotificationOptions) {
27+
const { t } = useI18n()
2528
const toast = useToast()
2629

2730
toast.add({
28-
title: 'Warning',
31+
title: t('Warning'),
2932
description: options.content,
3033
color: 'warning',
3134
})
3235
}
3336

3437
export function notifyInfo(options: NotificationOptions) {
38+
const { t } = useI18n()
3539
const toast = useToast()
3640

3741
toast.add({
38-
title: 'Infor',
42+
title: t('Infor'),
3943
description: options.content,
4044
color: 'info',
4145
})

i18n/en.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,9 @@
221221
"You are not subscribed to any monthly plan": "You are not subscribed to any monthly plan",
222222
"View Subscriptions": "View Subscriptions",
223223
"Most popular": "Most popular",
224-
"You are not authorized to perform this action.": "You are not authorized to perform this action."
224+
"You are not authorized to perform this action.": "You are not authorized to perform this action.",
225+
"Error": "Error",
226+
"Success": "Success",
227+
"Warning": "Warning",
228+
"Infor": "Infor"
225229
}

i18n/vi.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,9 @@
221221
"You are not subscribed to any monthly plan": "Bạn chưa đăng ký gói hàng tháng nào",
222222
"View Subscriptions": "Xem các gói đăng ký",
223223
"Most popular": "Phổ biến nhất",
224-
"You are not authorized to perform this action.": "Bạn không có quyền thực hiện hành động này."
224+
"You are not authorized to perform this action.": "Bạn không có quyền thực hiện hành động này.",
225+
"Error": "Lỗi",
226+
"Success": "Thành công",
227+
"Warning": "Cảnh báo",
228+
"Infor": "Thông tin"
225229
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thecodeorigin/nuxt",
33
"type": "module",
4-
"version": "2.5.5",
4+
"version": "2.5.6",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org",
77
"access": "public"

0 commit comments

Comments
 (0)