mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 13:31:32 +08:00
feat(toast): add i18n support for loading toast title
Use i18next to translate the loading toast title for better localization support
This commit is contained in:
parent
261b79198a
commit
c85fad90b5
@ -1,5 +1,6 @@
|
||||
import { addToast, closeAll, closeToast, getToastQueue, isToastClosing } from '@heroui/toast'
|
||||
import { RequireSome } from '@renderer/types'
|
||||
import { t } from 'i18next'
|
||||
|
||||
type AddToastProps = Parameters<typeof addToast>[0]
|
||||
type ToastPropsColored = Omit<AddToastProps, 'color'>
|
||||
@ -54,7 +55,7 @@ export const loading = (args: RequireSome<AddToastProps, 'promise'>) => {
|
||||
if (args.timeout === undefined) {
|
||||
args.timeout = 1
|
||||
}
|
||||
return addToast(args)
|
||||
return addToast({ title: t('common.loading'), ...args })
|
||||
}
|
||||
|
||||
export const getToastUtilities = () =>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user