|
2 | 2 | import { useI18n } from '#i18n'
|
3 | 3 | import { useRuntimeConfig } from '#imports'
|
4 | 4 | import { useColor, useTypography } from '@vuejs-jp/composable'
|
5 |
| -import { useLocaleCurrent } from '@/composables/useLocaleCurrent' |
| 5 | +import { useTranslation } from '@/composables/useTranslation' |
6 | 6 |
|
7 | 7 | const config = useRuntimeConfig()
|
8 | 8 | const { fontWeight, fontSize } = useTypography()
|
9 | 9 | const { color } = useColor()
|
10 | 10 |
|
11 |
| -const { t, te } = useI18n() |
12 |
| -const { locale } = useLocaleCurrent() |
13 |
| -/** |
14 |
| - * Get translation or return empty string |
15 |
| - * @param key - translation key |
16 |
| - * @returns translation or empty string |
17 |
| - */ |
18 |
| -function getTranslationOrDefault(key: string): string { |
19 |
| - return te(key, locale.value) ? t(key) : '' |
20 |
| -} |
| 11 | +const { t } = useI18n() |
| 12 | +const { translate } = useTranslation() |
21 | 13 |
|
22 | 14 | const periodStart = {
|
23 | 15 | prefixYear: t('prefix_year'),
|
24 | 16 | date: t('sponsor.start_date'),
|
25 |
| - dayOfWeek: getTranslationOrDefault('day_of_week.monday'), |
| 17 | + dayOfWeek: translate('day_of_week.monday'), |
26 | 18 | }
|
27 | 19 |
|
28 | 20 | // const periodEnd = {
|
29 | 21 | // suffixYear: t('suffix_year'),
|
30 | 22 | // date: t('sponsor.end_date'),
|
31 |
| -// dayOfWeek: getTranslationOrDefault('day_of_week.thursday'), |
| 23 | +// dayOfWeek: translate('day_of_week.thursday'), |
32 | 24 | // }
|
33 | 25 | </script>
|
34 | 26 |
|
|
0 commit comments