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:
icarus 2025-10-13 21:48:56 +08:00
parent 261b79198a
commit c85fad90b5

View File

@ -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 = () =>