11<script setup lang="ts">
2- import { useRuntimeConfig } from ' #imports'
32import { useI18n } from ' #i18n'
3+ import { useRuntimeConfig } from ' #imports'
44import { useColor , useTypography } from ' @vuejs-jp/composable'
5+ import { useLocaleCurrent } from ' @/composables/useLocaleCurrent'
56
67const config = useRuntimeConfig ()
7- const { locale } = useI18n ()
88const { fontWeight, fontSize } = useTypography ()
99const { color } = useColor ()
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+ }
21+
22+ const periodStart = {
23+ prefixYear: t (' prefix_year' ),
24+ date: t (' start_date' ),
25+ dayOfWeek: getTranslationOrDefault (' day_of_week.monday' ),
26+ }
27+
28+ const periodEnd = {
29+ suffixYear: t (' suffix_year' ),
30+ date: t (' end_date' ),
31+ dayOfWeek: getTranslationOrDefault (' day_of_week.thursday' ),
32+ }
1033 </script >
1134
1235<template >
@@ -37,10 +60,7 @@ const { color } = useColor()
3760 >
3861 {{ $t('sponsor.apply_period') }}
3962 </h3 >
40- <VFDatePeriod
41- :start =" { year: 2024, date: '4.8', dayOfWeek: locale === 'ja' ? $t('day_of_week.monday') : '' }"
42- :end =" { date: '4.25', dayOfWeek: locale === 'ja' ? $t('day_of_week.thursday') : '' }"
43- />
63+ <VFDatePeriod :start =" periodStart" :end =" periodEnd" />
4464 </template >
4565
4666 <div class =" sponsor-buttons" >
@@ -69,8 +89,7 @@ const { color } = useColor()
6989</template >
7090
7191<style scoped>
72- @import url (" ~/assets/media.css" );
73- @import url (" ~/assets/sample.css" );
92+ @import url (' ~/assets/media.css' );
7493
7594.sponsor {
7695 --sponsor-padding : calc (var (--unit ) * 5.25 ) 0 ;
@@ -95,6 +114,7 @@ const { color } = useColor()
95114 margin : 0 1.5% ;
96115 background-color : white ;
97116 max-width : 960px ;
117+ text-align : center ;
98118}
99119
100120.sponsor-text {
@@ -108,7 +128,7 @@ const { color } = useColor()
108128
109129 &::v-deep a :hover {
110130 opacity : 0.4 ;
111- transition : .2s ;
131+ transition : 0 .2s ;
112132 }
113133
114134 &:deep(p ) {
0 commit comments