🌐 (notification) add i18n for notif

This commit is contained in:
2020-07-18 23:41:27 +02:00
parent 62749a3bf7
commit 83245b1f12
4 changed files with 30 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import { StopwatchState } from '@/types/StopwatchState'
import { notify } from '@/utils/notification'
import { useInterval } from './useInterval'
import { useWakeLock } from './useWakeLock'
import i18n from '@/i18n'
const format = (num: number) => {
return num.toString().padStart(2, '0')
@@ -48,8 +49,8 @@ export const useTimer = () => {
const dev = isDev1Turn.value ? 'Dev 1' : 'Dev 2'
notify('Change!', {
body: `${dev}, your turn!`
notify(i18n.t('notification.change.title').toString(), {
body: i18n.t('notification.change.body', { dev }).toString()
})
}
}, 1000)