@opendesign-plus/components 0.0.1-rc.2 → 0.0.1-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-OElCookieNotice.cjs.js +1 -0
- package/dist/chunk-OElCookieNotice.es.js +839 -0
- package/dist/components/OBanner.vue.d.ts +10 -1
- package/dist/components/OCookieNotice.vue.d.ts +6 -5
- package/dist/components/OFooter.vue.d.ts +46 -0
- package/dist/components/OHeaderSearch.vue.d.ts +10 -14
- package/dist/components/OHeaderUser.vue.d.ts +40 -0
- package/dist/components/OSourceCode.vue.d.ts +18 -0
- package/dist/components/activity/OActivityApproval.vue.d.ts +273 -0
- package/dist/components/activity/OActivityForm.vue.d.ts +138 -0
- package/dist/components/activity/OMyActivityCalendar.vue.d.ts +570 -0
- package/dist/components/activity/composables/useActivityConfig.d.ts +17 -0
- package/dist/components/activity/config.d.ts +1 -0
- package/dist/components/activity/index.d.ts +615 -0
- package/dist/components/activity/types.d.ts +88 -0
- package/dist/components/element-plus/OElCookieNotice.vue.d.ts +34 -0
- package/dist/components/element-plus/index.d.ts +2 -0
- package/dist/components/events/OEventsApply.vue.d.ts +16 -0
- package/dist/components/events/OEventsCalendar.vue.d.ts +5 -0
- package/dist/components/events/OEventsList.vue.d.ts +26 -0
- package/dist/components/events/config.d.ts +14 -0
- package/dist/components/events/index.d.ts +78 -0
- package/dist/components/events/types.d.ts +69 -0
- package/dist/components/events/utils.d.ts +7 -0
- package/dist/components/header/OHeader.vue.d.ts +30 -0
- package/dist/components/header/OHeaderMobile.vue.d.ts +178 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +13 -0
- package/dist/components/header/components/HeaderNav.vue.d.ts +19 -0
- package/dist/components/header/components/HeaderNavMobile.vue.d.ts +36 -0
- package/dist/components/header/index.d.ts +152 -0
- package/dist/components/header/types.d.ts +84 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +295 -0
- package/dist/components/meeting/OMeetingForm.vue.d.ts +143 -0
- package/dist/components/meeting/OMeetingPlayback.vue.d.ts +45 -0
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +578 -0
- package/dist/components/meeting/OSigMeetingCalendar.vue.d.ts +24 -0
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +28 -0
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +664 -0
- package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +13 -0
- package/dist/components/meeting/components/OMeetingPlaybackSubtitles.vue.d.ts +5 -0
- package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +17 -0
- package/dist/components/meeting/components/OSigMeetingAside.vue.d.ts +16 -0
- package/dist/components/meeting/composables/useMeetingConfig.d.ts +14 -0
- package/dist/components/meeting/config.d.ts +12 -0
- package/dist/components/meeting/index.d.ts +786 -0
- package/dist/components/meeting/types.d.ts +233 -0
- package/dist/components/meeting/utils.d.ts +8 -0
- package/dist/components.cjs.js +224 -1
- package/dist/components.css +1 -1
- package/dist/components.element.cjs.js +1 -0
- package/dist/components.element.es.js +4 -0
- package/dist/components.es.js +44417 -784
- package/dist/index.d.ts +9 -2
- package/docs/design.md +27 -27
- package/docs/design_banner.md +41 -41
- package/docs/design_section.md +27 -27
- package/package.json +13 -4
- package/scripts/generate-components-index.js +103 -80
- package/src/assets/events/svg-icons/icon-checked.svg +3 -0
- package/src/assets/events/svg-icons/icon-competition.svg +7 -0
- package/src/assets/events/svg-icons/icon-events.svg +4 -0
- package/src/assets/events/svg-icons/icon-release.svg +4 -0
- package/src/assets/events/svg-icons/icon-summit.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-all.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-backward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-calendar.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-cancel.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-captions.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-close-captions.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-close-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-copy.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-create.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-delete.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-empty.svg +31 -0
- package/src/assets/meeting/svg-icons/icon-empty_dark.svg +49 -0
- package/src/assets/meeting/svg-icons/icon-event.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-export.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-forward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-help.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-important.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-info.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meet.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meeting-message.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-meeting.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-play.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-playing-tip.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-playing.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-question.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-sound.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-speaker.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-summit.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-telligent.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-tip.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-todo.svg +4 -0
- package/src/assets/meeting/transparent.png +0 -0
- package/src/assets/svg-icons/icon-arrow-left.svg +3 -0
- package/src/assets/svg-icons/icon-avatar-line.svg +3 -0
- package/src/assets/svg-icons/icon-caret-left.svg +3 -0
- package/src/assets/svg-icons/icon-caret-right.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-down.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-right.svg +3 -3
- package/src/assets/svg-icons/icon-chevron-up.svg +3 -0
- package/src/assets/svg-icons/icon-close.svg +3 -3
- package/src/assets/svg-icons/icon-delete.svg +3 -3
- package/src/assets/svg-icons/icon-filter.svg +3 -0
- package/src/assets/svg-icons/icon-header-back.svg +3 -3
- package/src/assets/svg-icons/icon-header-delete.svg +3 -3
- package/src/assets/svg-icons/icon-header-menu.svg +3 -0
- package/src/assets/svg-icons/icon-header-person.svg +3 -0
- package/src/assets/svg-icons/icon-header-search.svg +4 -4
- package/src/assets/svg-icons/icon-loading.svg +4 -0
- package/src/assets/svg-icons/icon-locale.svg +3 -0
- package/src/assets/svg-icons/icon-log-off.svg +3 -0
- package/src/assets/svg-icons/icon-message.svg +3 -0
- package/src/assets/svg-icons/icon-moon.svg +3 -3
- package/src/assets/svg-icons/icon-outlink.svg +3 -0
- package/src/assets/svg-icons/icon-overview.svg +3 -0
- package/src/assets/svg-icons/icon-search.svg +3 -0
- package/src/assets/svg-icons/icon-setting.svg +3 -0
- package/src/assets/svg-icons/icon-sun.svg +3 -3
- package/src/assets/svg-icons/icon-tips.svg +3 -0
- package/src/components/OBanner.vue +398 -390
- package/src/components/OCookieNotice.vue +575 -424
- package/src/components/OFooter.vue +576 -0
- package/src/components/OHeaderSearch.vue +601 -601
- package/src/components/OHeaderUser.vue +237 -0
- package/src/components/OPlusConfigProvider.vue +32 -32
- package/src/components/OSection.vue +178 -178
- package/src/components/OSourceCode.vue +151 -0
- package/src/components/OThemeSwitcher.vue +108 -108
- package/src/components/activity/OActivityApproval.vue +864 -0
- package/src/components/activity/OActivityForm.vue +542 -0
- package/src/components/activity/OMyActivityCalendar.vue +1502 -0
- package/src/components/activity/composables/useActivityConfig.ts +141 -0
- package/src/components/activity/config.ts +1 -0
- package/src/components/activity/index.ts +24 -0
- package/src/components/activity/types.ts +95 -0
- package/src/components/common/AppAvatar.vue +83 -0
- package/src/components/common/ClientOnlyWrapper.ts +21 -21
- package/src/components/common/ContentWrapper.vue +85 -85
- package/src/components/common/MoreText.vue +124 -0
- package/src/components/common/ThFilter.vue +330 -0
- package/src/components/element-plus/OElCookieNotice.vue +603 -0
- package/src/components/element-plus/index.ts +3 -0
- package/src/components/events/OEventsApply.vue +418 -0
- package/src/components/events/OEventsCalendar.vue +598 -0
- package/src/components/events/OEventsList.vue +389 -0
- package/src/components/events/config.ts +35 -0
- package/src/components/events/index.ts +24 -0
- package/src/components/events/types.ts +83 -0
- package/src/components/events/utils.ts +9 -0
- package/src/components/header/OHeader.vue +157 -0
- package/src/components/header/OHeaderMobile.vue +184 -0
- package/src/components/header/components/HeaderContent.vue +1125 -0
- package/src/components/header/components/HeaderNav.vue +278 -0
- package/src/components/header/components/HeaderNavMobile.vue +380 -0
- package/src/components/header/index.ts +16 -0
- package/src/components/header/types.ts +95 -0
- package/src/components/meeting/OMeetingCalendar.vue +890 -0
- package/src/components/meeting/OMeetingForm.vue +1072 -0
- package/src/components/meeting/OMeetingPlayback.vue +439 -0
- package/src/components/meeting/OMyMeetingCalendar.vue +1508 -0
- package/src/components/meeting/OSigMeetingCalendar.vue +413 -0
- package/src/components/meeting/components/OMeetingCalendarList.vue +515 -0
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +210 -0
- package/src/components/meeting/components/OMeetingDetail.vue +244 -0
- package/src/components/meeting/components/OMeetingPlaybackSubtitles.vue +611 -0
- package/src/components/meeting/components/OMeetingPlaybackVideo.vue +741 -0
- package/src/components/meeting/components/OSigMeetingAside.vue +199 -0
- package/src/components/meeting/composables/useMeetingConfig.ts +108 -0
- package/src/components/meeting/config.ts +48 -0
- package/src/components/meeting/index.ts +45 -0
- package/src/components/meeting/types.ts +266 -0
- package/src/components/meeting/utils.ts +70 -0
- package/src/draft/Banner.vue +265 -265
- package/src/draft/ButtonCards.vue +105 -105
- package/src/draft/Feature.vue +133 -133
- package/src/draft/Footer.vue +512 -512
- package/src/draft/HorizontalAnchor.vue +165 -165
- package/src/draft/ItemSwiper.vue +133 -133
- package/src/draft/Logo.vue +141 -141
- package/src/draft/LogoCard.vue +74 -74
- package/src/draft/LogoV2.vue +19 -19
- package/src/draft/MainCard.vue +38 -38
- package/src/draft/MultiCard.vue +94 -94
- package/src/draft/MultiIconCard.vue +73 -73
- package/src/draft/OInfoCard.vue +176 -176
- package/src/draft/Process.vue +81 -81
- package/src/draft/Section.vue +167 -167
- package/src/draft/SingleTabCard.vue +84 -84
- package/src/draft/SliderCard.vue +110 -110
- package/src/env.d.ts +16 -1
- package/src/i18n/en.ts +264 -20
- package/src/i18n/index.ts +56 -42
- package/src/i18n/zh.ts +253 -9
- package/src/index.ts +14 -3
- package/src/shared/provide.ts +6 -6
- package/src/shims-vue-dompurify-html.d.ts +17 -0
- package/src/vue.d.ts +9 -9
- package/tsconfig.json +37 -33
- package/vite.config.ts +119 -94
- package/dist/components/OCookieNoticeEl.vue.d.ts +0 -29
- package/dist/components.umd.js +0 -1
- package/src/components/OCookieNoticeEl.vue +0 -404
package/src/draft/SliderCard.vue
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { OCarousel, OCarouselItem, OFigure, OLink } from '@opensig/opendesign';
|
|
3
|
-
import { useScreen } from '@/composables/useScreen';
|
|
4
|
-
|
|
5
|
-
const { lePadV } = useScreen();
|
|
6
|
-
|
|
7
|
-
interface CardT {
|
|
8
|
-
title: string;
|
|
9
|
-
content: string;
|
|
10
|
-
cover: string;
|
|
11
|
-
href: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const props = defineProps({
|
|
15
|
-
cards: {
|
|
16
|
-
type: Array as () => CardT[],
|
|
17
|
-
default: () => [],
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<div class="wrapper">
|
|
24
|
-
<OCarousel v-if="!lePadV" class="slider-card" indicator-click :loop="true" effect="toggle">
|
|
25
|
-
<OCarouselItem v-for="(card, index) in props.cards" :key="index" class="slider-card-item">
|
|
26
|
-
<OFigure :src="card.cover" :alt="card.title" class="slider-card-cover">
|
|
27
|
-
<div class="card-content">
|
|
28
|
-
<div class="card-title">{{ card.title }}</div>
|
|
29
|
-
<div class="card-description">{{ card.content }}</div>
|
|
30
|
-
<OLink v-if="card.href" :href="card.href" class="card-link"> 了解更多 </OLink>
|
|
31
|
-
</div>
|
|
32
|
-
</OFigure>
|
|
33
|
-
</OCarouselItem>
|
|
34
|
-
</OCarousel>
|
|
35
|
-
<OCarousel v-else class="slider-card" indicator-click :loop="true" effect="toggle">
|
|
36
|
-
<OCarouselItem v-for="(card, index) in props.cards" :key="index" class="slider-card-item">
|
|
37
|
-
<OFigure :src="card.cover" :alt="card.title" class="slider-card-cover">
|
|
38
|
-
<div class="card-content">
|
|
39
|
-
<div class="card-title">{{ card.title }}</div>
|
|
40
|
-
<div class="card-description">{{ card.content }}</div>
|
|
41
|
-
<OLink v-if="card.href" :href="card.href" class="card-link"> 了解更多 </OLink>
|
|
42
|
-
</div>
|
|
43
|
-
</OFigure>
|
|
44
|
-
</OCarouselItem>
|
|
45
|
-
</OCarousel>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<style lang="scss" scoped>
|
|
50
|
-
.slider-card {
|
|
51
|
-
--slide-width: calc(70vw - 36px);
|
|
52
|
-
--slide-gap: 16px;
|
|
53
|
-
--carousel-indicator-offset: -32px;
|
|
54
|
-
height: 360px;
|
|
55
|
-
width: 100%;
|
|
56
|
-
overflow: visible;
|
|
57
|
-
:deep(.the-slider-container) {
|
|
58
|
-
height: 100%;
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
}
|
|
61
|
-
:deep(.o-carousel-indicator-bar) {
|
|
62
|
-
width: 100%;
|
|
63
|
-
&::after {
|
|
64
|
-
border-radius: 6px;
|
|
65
|
-
}
|
|
66
|
-
&::before {
|
|
67
|
-
border-radius: 6px;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
@include respond-to('pc_s') {
|
|
71
|
-
height: 300px;
|
|
72
|
-
}
|
|
73
|
-
@include respond-to('<=laptop') {
|
|
74
|
-
height: 280px;
|
|
75
|
-
}
|
|
76
|
-
@include respond-to('<=pad_v') {
|
|
77
|
-
--slide-width: calc(100vw - 64px);
|
|
78
|
-
width: calc(var(--slide-gap) + var(--slide-width));
|
|
79
|
-
height: 184px;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.slider-card-item {
|
|
84
|
-
height: 100%;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.slider-card-cover {
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 100%;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.card-content {
|
|
93
|
-
padding: 0 96px;
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
justify-content: center;
|
|
97
|
-
height: 100%;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.card-title {
|
|
101
|
-
@include h1;
|
|
102
|
-
font-weight: 600;
|
|
103
|
-
color: var(--o-color-info1);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.card-description {
|
|
107
|
-
margin-top: var(--o3-gap-3);
|
|
108
|
-
margin-bottom: var(--o3-gap-7);
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { OCarousel, OCarouselItem, OFigure, OLink } from '@opensig/opendesign';
|
|
3
|
+
import { useScreen } from '@/composables/useScreen';
|
|
4
|
+
|
|
5
|
+
const { lePadV } = useScreen();
|
|
6
|
+
|
|
7
|
+
interface CardT {
|
|
8
|
+
title: string;
|
|
9
|
+
content: string;
|
|
10
|
+
cover: string;
|
|
11
|
+
href: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
cards: {
|
|
16
|
+
type: Array as () => CardT[],
|
|
17
|
+
default: () => [],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="wrapper">
|
|
24
|
+
<OCarousel v-if="!lePadV" class="slider-card" indicator-click :loop="true" effect="toggle">
|
|
25
|
+
<OCarouselItem v-for="(card, index) in props.cards" :key="index" class="slider-card-item">
|
|
26
|
+
<OFigure :src="card.cover" :alt="card.title" class="slider-card-cover">
|
|
27
|
+
<div class="card-content">
|
|
28
|
+
<div class="card-title">{{ card.title }}</div>
|
|
29
|
+
<div class="card-description">{{ card.content }}</div>
|
|
30
|
+
<OLink v-if="card.href" :href="card.href" class="card-link"> 了解更多 </OLink>
|
|
31
|
+
</div>
|
|
32
|
+
</OFigure>
|
|
33
|
+
</OCarouselItem>
|
|
34
|
+
</OCarousel>
|
|
35
|
+
<OCarousel v-else class="slider-card" indicator-click :loop="true" effect="toggle">
|
|
36
|
+
<OCarouselItem v-for="(card, index) in props.cards" :key="index" class="slider-card-item">
|
|
37
|
+
<OFigure :src="card.cover" :alt="card.title" class="slider-card-cover">
|
|
38
|
+
<div class="card-content">
|
|
39
|
+
<div class="card-title">{{ card.title }}</div>
|
|
40
|
+
<div class="card-description">{{ card.content }}</div>
|
|
41
|
+
<OLink v-if="card.href" :href="card.href" class="card-link"> 了解更多 </OLink>
|
|
42
|
+
</div>
|
|
43
|
+
</OFigure>
|
|
44
|
+
</OCarouselItem>
|
|
45
|
+
</OCarousel>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style lang="scss" scoped>
|
|
50
|
+
.slider-card {
|
|
51
|
+
--slide-width: calc(70vw - 36px);
|
|
52
|
+
--slide-gap: 16px;
|
|
53
|
+
--carousel-indicator-offset: -32px;
|
|
54
|
+
height: 360px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
overflow: visible;
|
|
57
|
+
:deep(.the-slider-container) {
|
|
58
|
+
height: 100%;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
:deep(.o-carousel-indicator-bar) {
|
|
62
|
+
width: 100%;
|
|
63
|
+
&::after {
|
|
64
|
+
border-radius: 6px;
|
|
65
|
+
}
|
|
66
|
+
&::before {
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@include respond-to('pc_s') {
|
|
71
|
+
height: 300px;
|
|
72
|
+
}
|
|
73
|
+
@include respond-to('<=laptop') {
|
|
74
|
+
height: 280px;
|
|
75
|
+
}
|
|
76
|
+
@include respond-to('<=pad_v') {
|
|
77
|
+
--slide-width: calc(100vw - 64px);
|
|
78
|
+
width: calc(var(--slide-gap) + var(--slide-width));
|
|
79
|
+
height: 184px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.slider-card-item {
|
|
84
|
+
height: 100%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.slider-card-cover {
|
|
88
|
+
width: 100%;
|
|
89
|
+
height: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.card-content {
|
|
93
|
+
padding: 0 96px;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
height: 100%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.card-title {
|
|
101
|
+
@include h1;
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
color: var(--o-color-info1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.card-description {
|
|
107
|
+
margin-top: var(--o3-gap-3);
|
|
108
|
+
margin-bottom: var(--o3-gap-7);
|
|
109
|
+
}
|
|
110
|
+
</style>
|
package/src/env.d.ts
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.png' {
|
|
4
|
+
const src: string;
|
|
5
|
+
export default src;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module '*.jpg' {
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare module '*.svg' {
|
|
14
|
+
const src: string;
|
|
15
|
+
export default src;
|
|
16
|
+
}
|
package/src/i18n/en.ts
CHANGED
|
@@ -1,20 +1,264 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
search: 'Search',
|
|
3
|
-
'search.hot': 'Top search',
|
|
4
|
-
'search.placeholder': 'Please enter the content',
|
|
5
|
-
'search.expandedPlaceholder': 'Please enter the content',
|
|
6
|
-
'search.history': 'History',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
|
|
1
|
+
export default {
|
|
2
|
+
search: 'Search',
|
|
3
|
+
'search.hot': 'Top search',
|
|
4
|
+
'search.placeholder': 'Please enter the content',
|
|
5
|
+
'search.expandedPlaceholder': 'Please enter the content',
|
|
6
|
+
'search.history': 'History',
|
|
7
|
+
'meeting.audioToText': 'Speech to Text',
|
|
8
|
+
'meeting.item1': 'Convener: ',
|
|
9
|
+
'meeting.item2': 'SIG: ',
|
|
10
|
+
'meeting.item3': 'Time: ',
|
|
11
|
+
'meeting.item4': 'Details: ',
|
|
12
|
+
'meeting.baseInfo': 'Basic Info',
|
|
13
|
+
'meeting.subject': 'Topics',
|
|
14
|
+
'meeting.speaker': 'Speaker',
|
|
15
|
+
'meeting.replay': 'Intelligent Playback',
|
|
16
|
+
'meeting.monday': 'Monday',
|
|
17
|
+
'meeting.tuesday': 'Tuesday',
|
|
18
|
+
'meeting.wednesday': 'Wednesday',
|
|
19
|
+
'meeting.thursday': 'Thursday',
|
|
20
|
+
'meeting.friday': 'Friday',
|
|
21
|
+
'meeting.saturday': 'Saturday',
|
|
22
|
+
'meeting.sunday': 'Sunday',
|
|
23
|
+
'meeting.sigGroup': 'The {0} group',
|
|
24
|
+
'meeting.invite': ' invites you to',
|
|
25
|
+
'meeting.edit': ' [modified]',
|
|
26
|
+
'meeting.cancel': ' [canceled]',
|
|
27
|
+
'meeting.dateTime': ' {1} on {0}',
|
|
28
|
+
'meeting.meeting': ' the meeting',
|
|
29
|
+
'meeting.cycleMeeting': ' the recurring meeting',
|
|
30
|
+
'meeting.meetingText': ' {1} at {0}.',
|
|
31
|
+
'meeting.singleMeetingText': ' {1} at {0}.',
|
|
32
|
+
'meeting.cycleMeetingText': ' scheduled at {startTime} to {endTime} {cycleType} from {startDate} to {endDate}.',
|
|
33
|
+
'meeting.cycleMeetingText2': '{startTime} to {endTime} (UTC+08:00)Beijing {cycleType} from {startDate} to {endDate}.',
|
|
34
|
+
'meeting.cycleDay': ' every day',
|
|
35
|
+
'meeting.cycleWeek.one': 'on {0} every week',
|
|
36
|
+
'meeting.cycleWeek.other': 'on {0} every {1} weeks',
|
|
37
|
+
'meeting.cycleSplit': ', ',
|
|
38
|
+
'meeting.cycleMonth': ' on {0} of every month',
|
|
39
|
+
'meeting.myMeeting': 'My Meetings',
|
|
40
|
+
'meeting.meetingCancel': '[{0}] meeting canceled.',
|
|
41
|
+
'meeting.todayNonMeeting': 'No meetings scheduled for today.',
|
|
42
|
+
'meeting.online': 'Online',
|
|
43
|
+
'meeting.offline': 'Offline',
|
|
44
|
+
'meeting.meetingSingle': 'This meeting',
|
|
45
|
+
'meeting.meetingCycle': 'All recurring meetings',
|
|
46
|
+
'meeting.bookMeeting': 'Book Meeting',
|
|
47
|
+
'meeting.book': 'Book',
|
|
48
|
+
'meeting.meetingCancelled': '[Canceled]',
|
|
49
|
+
'meeting.cycle': 'Recurrence',
|
|
50
|
+
'meeting.joinMeeting': 'Join',
|
|
51
|
+
'meeting.sign': 'Sign Up',
|
|
52
|
+
'meeting.detail': 'View Details',
|
|
53
|
+
'meeting.meetingSummary': 'Minutes',
|
|
54
|
+
'meeting.viewRecord': 'Playback',
|
|
55
|
+
'meeting.editMeeting': 'Modify',
|
|
56
|
+
'meeting.cancelMeeting': 'Cancel',
|
|
57
|
+
'meeting.nextMonth': 'Next month',
|
|
58
|
+
'meeting.preMonth': 'Last month',
|
|
59
|
+
'meeting.emptyMeeting': 'No meetings. ',
|
|
60
|
+
'meeting.meetingHandleText': 'Which do you want to {0}?',
|
|
61
|
+
'meeting.edit2': 'modify',
|
|
62
|
+
'meeting.confirmCancel': 'Cancel',
|
|
63
|
+
'meeting.confirmCancelDesc': 'Are you sure you want to cancel the "{0}" meeting?',
|
|
64
|
+
'meeting.enterMeetingName': 'Enter a meeting title.',
|
|
65
|
+
'meeting.meetingNameTooLong': 'Enter a maximum of 128 characters.',
|
|
66
|
+
'meeting.meetingAgendaTooLong': 'Enter a maximum of 4096 characters.',
|
|
67
|
+
'meeting.meetingSig': 'SIG',
|
|
68
|
+
'meeting.meetingGroup': 'Group',
|
|
69
|
+
'meeting.selectSig': 'Select a SIG.',
|
|
70
|
+
'meeting.selectGroup': 'Select a Group.',
|
|
71
|
+
'meeting.enterEtherpad': 'Enter Etherpad.',
|
|
72
|
+
'meeting.etherpadDesc': 'A meeting assistant for recording meeting minutes and conversations.',
|
|
73
|
+
'meeting.selectDate': 'Select a date.',
|
|
74
|
+
'meeting.finishMeetingConfig': 'Complete the meeting settings.',
|
|
75
|
+
'meeting.selectMeetingDate': 'Select a date.',
|
|
76
|
+
'meeting.selectMeetingTime': 'Select time.',
|
|
77
|
+
'meeting.invalidMeetingDuration': 'No time slots available for meetings within the selected timeframe.',
|
|
78
|
+
'meeting.endTimeAfterStartTime': 'The end time must be later than the start time.',
|
|
79
|
+
'meeting.startTimeBeforeEndTime': 'The start time must be later than the current time.',
|
|
80
|
+
'meeting.selectPlatform': 'Select platform.',
|
|
81
|
+
'meeting.meetingPlatform': 'Platform',
|
|
82
|
+
'meeting.meetingAgenda': 'Content',
|
|
83
|
+
'meeting.enterMeetingAgenda': 'Enter the meeting content.',
|
|
84
|
+
'meeting.emailTooLong': 'Enter a maximum of 1020 characters for the email addresses.',
|
|
85
|
+
'meeting.enterEmail': 'Enter email addresses, separated by commas (,) or semicolons (;).',
|
|
86
|
+
'meeting.meetingEmail': 'Email',
|
|
87
|
+
'meeting.meetingEmailDesc': 'The system automatically sends notifications to subscribed SIG members. You can include additional SIG or individual email addresses.',
|
|
88
|
+
'meeting.sigGroupEmail': 'SIG Mailing List',
|
|
89
|
+
'meeting.emailInvalid': 'Enter a valid email address.',
|
|
90
|
+
'meeting.singleEmailTooLong': 'Enter a maximum of 100 characters for each email address.',
|
|
91
|
+
'meeting.emailCountTooLong': 'Enter a maximum of 20 email addresses.',
|
|
92
|
+
'meeting.meetingHandleSuccess': '"{0}" meeting {1}.',
|
|
93
|
+
'meeting.editSuccess': 'edited',
|
|
94
|
+
'meeting.booSuccess': 'booked',
|
|
95
|
+
'meeting.meetingName': 'Title',
|
|
96
|
+
'meeting.meetingTime': 'Time',
|
|
97
|
+
'meeting.nonRepeat': 'Once',
|
|
98
|
+
'meeting.isRepeat': 'Recurrence',
|
|
99
|
+
'meeting.every': 'Every',
|
|
100
|
+
'meeting.in': 'On',
|
|
101
|
+
'meeting.selectRepeatDate': 'Select a date.',
|
|
102
|
+
'meeting.meetingDuration': 'Period',
|
|
103
|
+
'meeting.startDate': 'Start date',
|
|
104
|
+
'meeting.endDate': 'End date',
|
|
105
|
+
'meeting.meetingDate': 'Date',
|
|
106
|
+
'meeting.startTime': 'Start time',
|
|
107
|
+
'meeting.endTime': 'End time',
|
|
108
|
+
'meeting.meetingRecord': 'Recording',
|
|
109
|
+
'meeting.meetingRecordDesc': 'Enables auto screen recording. This service is provided by {0} Meeting. AI-powered playback will be automatically uploaded within one working day.',
|
|
110
|
+
'meeting.day0': 'day(s)',
|
|
111
|
+
'meeting.week0': 'week(s)',
|
|
112
|
+
'meeting.month0': 'month(s)',
|
|
113
|
+
'meeting.day': ' day',
|
|
114
|
+
'meeting.week': ' week',
|
|
115
|
+
'meeting.month': ' month',
|
|
116
|
+
'meeting.meetingDesc': 'To book a meeting, the SIG Maintainer or Committer access is required.',
|
|
117
|
+
'meeting.meetingBook': 'Book Meeting',
|
|
118
|
+
'meeting.latestMeeting': 'Latest Schedule:',
|
|
119
|
+
'meeting.meetingTypeAll': 'All',
|
|
120
|
+
'meeting.meetingTypeMeet': 'Meetings',
|
|
121
|
+
'meeting.meetingTypeEvents': 'Activities',
|
|
122
|
+
'meeting.meetingTypeSummit': 'Summit',
|
|
123
|
+
'meeting.allSigs': 'All SIGs',
|
|
124
|
+
'meeting.allGroups': 'All Groups',
|
|
125
|
+
'meeting.meetingCreator': 'Convener',
|
|
126
|
+
'meeting.meetingDate2': 'Time',
|
|
127
|
+
'meeting.meetingId': 'Meeting ID',
|
|
128
|
+
'meeting.meetingLink': 'Meeting Link',
|
|
129
|
+
'meeting.meetingEmptyText': 'No activities scheduled for today.',
|
|
130
|
+
'meeting.versionBanner': 'openUBMC 25.06 Available Now',
|
|
131
|
+
'meeting.version2509Banner': 'openUBMC 25.09 Available Now',
|
|
132
|
+
'meeting.version2512Banner': 'openUBMC 25.12 LTS 社区发行版正式上线',
|
|
133
|
+
'meeting.sigs': 'SIG Groups',
|
|
134
|
+
'meeting.groups': 'Groups',
|
|
135
|
+
'meeting.activityAddress': 'Address',
|
|
136
|
+
'meeting.livePlatform': 'Live Platform',
|
|
137
|
+
'meeting.meetingTopic': 'Topics: ',
|
|
138
|
+
'meeting.meetingDetail': 'Details',
|
|
139
|
+
'meeting.meetingEtherpad': 'Etherpad',
|
|
140
|
+
'meeting.meetingReplay': 'Playback',
|
|
141
|
+
'meeting.searchSubtitlePlaceholder': 'Enter',
|
|
142
|
+
'meeting.detailHalfYearMeetings': '默认显示近半年的会议。',
|
|
143
|
+
'meeting.tencent': 'Tencent',
|
|
144
|
+
'meeting.etherpad': 'Etherpad',
|
|
145
|
+
'common.confirm': 'Confirm',
|
|
146
|
+
'common.cancel': 'Cancel',
|
|
147
|
+
'common.copySuccess': 'Copied Successfully',
|
|
148
|
+
'common.close': 'Close',
|
|
149
|
+
'common.all': 'All',
|
|
150
|
+
'common.seeMore': 'View More',
|
|
151
|
+
'common.save': 'Save',
|
|
152
|
+
'common.detail': 'Detail',
|
|
153
|
+
'common.reset': 'Reset',
|
|
154
|
+
'common.more': 'More',
|
|
155
|
+
'cookie.title': '{0} Community Respects Your Privacy',
|
|
156
|
+
'cookie.desc': 'This site uses cookies from us and our partners to improve your browsing experience and make the site work properly. By clicking "Accept All", you consent to the use of cookies. By clicking "Reject All", you disable the use of unnecessary cookies. You can manage your cookie settings by clicking "Manage Cookies". For more information or to change your cookie settings, please refer to our ',
|
|
157
|
+
'cookie.about': 'About Cookies',
|
|
158
|
+
'cookie.acceptAll': 'Accept All',
|
|
159
|
+
'cookie.rejectAll': 'Reject All',
|
|
160
|
+
'cookie.manage': 'Manage Cookies',
|
|
161
|
+
'cookie.necessaryCookie': 'Strictly Necessary Cookies',
|
|
162
|
+
'cookie.alwaysOn': 'Always active',
|
|
163
|
+
'cookie.necessaryCookieDetail': 'These cookies are necessary for the site to work properly and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as logging in or filling in forms. You can set the browser to block these cookies, but that can make parts of the site not work. These cookies do not store any personally identifiable information.',
|
|
164
|
+
'cookie.analyticalCookie': 'Analytics Cookies',
|
|
165
|
+
'cookie.analyticalCookieDetail': 'We will use these cookies only with your consent. These cookies help us make improvements by collecting statistics such as the number of visits and traffic sources.',
|
|
166
|
+
'cookie.saveSetting': 'Save Settings',
|
|
167
|
+
'cookie.setting': 'Cookie settings',
|
|
168
|
+
'meeting.create': 'Create',
|
|
169
|
+
'meeting.createMeeting': 'Create Meeting',
|
|
170
|
+
'meeting.createActivity': 'Create Event',
|
|
171
|
+
'meeting.createPermission': 'Workspace role required to create meetings or events',
|
|
172
|
+
'meeting.createActivityPermission': 'Workspace role required to create events',
|
|
173
|
+
'meeting.myActivity': 'Events',
|
|
174
|
+
'meeting.activityName': 'Event Name',
|
|
175
|
+
'meeting.enterActivityName': 'Enter a name',
|
|
176
|
+
'meeting.activityOrganizer': 'Organizer',
|
|
177
|
+
'meeting.selectActivityOrganizer': 'Select organizer',
|
|
178
|
+
'meeting.activityDetail2': 'Details',
|
|
179
|
+
'meeting.activityType': 'Event Type',
|
|
180
|
+
'meeting.selectActivityType': 'Select type',
|
|
181
|
+
'meeting.activityTime': 'Event Time',
|
|
182
|
+
'meeting.selectActivityStartDate': 'Set start date',
|
|
183
|
+
'meeting.selectActivityEndDate': 'Set end date',
|
|
184
|
+
'meeting.registrationDeadline': 'Registration Deadline',
|
|
185
|
+
'meeting.selectActivityDeadline': 'Set deadline',
|
|
186
|
+
'meeting.registrationUrl': 'Registration URL',
|
|
187
|
+
'meeting.enterActivityRegistrationUrl': 'Enter registration URL',
|
|
188
|
+
'meeting.activityDetailUrl': 'Event Overview URL',
|
|
189
|
+
'meeting.enterActivityDetailUrl': 'Enter event overview URL',
|
|
190
|
+
'meeting.activityContent': 'Event Details',
|
|
191
|
+
'meeting.enterActivityContent': 'Enter event details',
|
|
192
|
+
'meeting.email': 'Email',
|
|
193
|
+
'meeting.enterEmailDesc': 'Enter the recipient email addresses. Separate multiple addresses with commas (,) or semicolons (;).',
|
|
194
|
+
'meeting.activityApprover': 'Approver',
|
|
195
|
+
'meeting.selectActivityApprover': 'Select approver',
|
|
196
|
+
'meeting.saveDraft': 'Save as Draft',
|
|
197
|
+
'meeting.cancelBtn': 'Cancel',
|
|
198
|
+
'meeting.communityActivityApproval': 'Approve Event',
|
|
199
|
+
'meeting.reviewActivityTip': 'Review events submitted for approval',
|
|
200
|
+
'meeting.applicant': 'Applicant',
|
|
201
|
+
'meeting.searchApplicant': 'Search applicant',
|
|
202
|
+
'meeting.submissionTime': 'Submission Time',
|
|
203
|
+
'meeting.status': 'Status',
|
|
204
|
+
'meeting.statusPending': 'Pending',
|
|
205
|
+
'meeting.statusApproved': 'Approved',
|
|
206
|
+
'meeting.statusRejected': 'Rejected',
|
|
207
|
+
'meeting.statusCanceled': 'Canceled',
|
|
208
|
+
'meeting.action': 'Action',
|
|
209
|
+
'meeting.cancelActivity': 'Cancel',
|
|
210
|
+
'meeting.approve': 'Approve',
|
|
211
|
+
'meeting.reject': 'Reject',
|
|
212
|
+
'meeting.approveReview': 'Approve',
|
|
213
|
+
'meeting.rejectReview': 'Reject',
|
|
214
|
+
'meeting.reviewNotes': 'Review Notes',
|
|
215
|
+
'meeting.enterReviewNotes': 'Enter review notes here',
|
|
216
|
+
'meeting.confirmCancelActivity': 'Cancel "{0}"? Once canceled, it will be removed from the homepage, and all registration data will be cleared. Please proceed with caution.',
|
|
217
|
+
'meeting.confirmBtn': 'OK',
|
|
218
|
+
'meeting.activityDetail': 'View Details',
|
|
219
|
+
'meeting.modifyActivity': 'Modify',
|
|
220
|
+
'meeting.withdrawReview': 'Withdraw',
|
|
221
|
+
'meeting.deleteActivity': 'Delete',
|
|
222
|
+
'meeting.submitReview': 'Submit',
|
|
223
|
+
'meeting.confirmDeleteActivity': 'Delete "{0}"? Once deleted, it will be removed from User Center.',
|
|
224
|
+
'meeting.registerNow': 'Register Now',
|
|
225
|
+
'meeting.onlineOffline': 'Online & Offline',
|
|
226
|
+
'meeting.statusDraft': 'Draft',
|
|
227
|
+
'meeting.statusUnderReview': 'Pending Review',
|
|
228
|
+
'meeting.statusRegistering': 'Registering',
|
|
229
|
+
'meeting.statusInProgress': 'In Progress',
|
|
230
|
+
'meeting.statusEnded': 'Finished',
|
|
231
|
+
'meeting.statusModified': 'Modified',
|
|
232
|
+
'meeting.reviewSuccess': '"{0}" reviewed',
|
|
233
|
+
'meeting.reviewFail': '"{0}" review failed',
|
|
234
|
+
'meeting.reviewNotesLabel': 'Review Notes',
|
|
235
|
+
'meeting.reviewed': 'Reviewed',
|
|
236
|
+
'meeting.activityActionSuccess': '"{0}" {1} successful',
|
|
237
|
+
'meeting.activityActionFail': '"{0}" {1} failed',
|
|
238
|
+
'meeting.activityNameMaxLength': 'Event name cannot exceed 50 characters',
|
|
239
|
+
'meeting.selectActivityTime': 'Select event time',
|
|
240
|
+
'meeting.selectActivityDate': 'Select event date',
|
|
241
|
+
'meeting.activityTimeRange': 'Start and end time must be between 8:00-22:00',
|
|
242
|
+
'meeting.endDateAfterStartDate': 'End date must be after start date',
|
|
243
|
+
'meeting.registerDeadlineBeforeEnd': 'Registration deadline must be before end date',
|
|
244
|
+
'meeting.enterActivityAddress': 'Enter event location',
|
|
245
|
+
'meeting.activityAddressMaxLength': 'Event location cannot exceed 255 characters',
|
|
246
|
+
'meeting.invalidRegistrationUrl': 'Enter a valid registration URL',
|
|
247
|
+
'meeting.invalidActivityDetailUrl': 'Enter a valid event detail URL',
|
|
248
|
+
'meeting.activityContentMaxLength': 'Event content cannot exceed 1000 characters',
|
|
249
|
+
'meeting.revokeActivitySuccess': '"{0}" event review withdrawn successfully',
|
|
250
|
+
'meeting.revokeActivityFail': '"{0}" event review withdrawal failed',
|
|
251
|
+
'meeting.submitReviewSuccess': '"{0}" event submitted for review successfully',
|
|
252
|
+
'meeting.submitReviewFail': '"{0}" event submission failed',
|
|
253
|
+
'meeting.deleteActivitySuccess': '"{0}" event deleted successfully',
|
|
254
|
+
'meeting.deleteActivityFail': '"{0}" event deletion failed',
|
|
255
|
+
'meeting.loading': 'Loading...',
|
|
256
|
+
'meeting.confirmRevokeActivity': 'Are you sure you want to withdraw "{0}" event? After withdrawal, the event will become a draft.',
|
|
257
|
+
'events.status': 'Status',
|
|
258
|
+
'events.statusAll': 'All',
|
|
259
|
+
'events.statusIng': 'Progress',
|
|
260
|
+
'events.statusFinish': 'Finish',
|
|
261
|
+
'events.searchPlaceholder': 'Enter search...',
|
|
262
|
+
'common.collapse': 'Collapse',
|
|
263
|
+
'common.expand': 'Expand',
|
|
264
|
+
};
|
package/src/i18n/index.ts
CHANGED
|
@@ -1,42 +1,56 @@
|
|
|
1
|
-
import { computed, inject, getCurrentInstance, ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
import zh from './zh';
|
|
4
|
-
import en from './en';
|
|
5
|
-
import { configProviderInjectKey } from '@/shared/provide';
|
|
6
|
-
import { isString, isUndefined } from '@opensig/opendesign';
|
|
7
|
-
|
|
8
|
-
const i18nLangs = ref({
|
|
9
|
-
zh,
|
|
10
|
-
en,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
1
|
+
import { computed, inject, getCurrentInstance, ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
import zh from './zh';
|
|
4
|
+
import en from './en';
|
|
5
|
+
import { configProviderInjectKey } from '@/shared/provide';
|
|
6
|
+
import { isString, isUndefined } from '@opensig/opendesign';
|
|
7
|
+
|
|
8
|
+
const i18nLangs = ref({
|
|
9
|
+
zh,
|
|
10
|
+
en,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export enum Locales {
|
|
14
|
+
ZH = 'zh',
|
|
15
|
+
EN = 'en',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useI18n() {
|
|
19
|
+
const instance = getCurrentInstance();
|
|
20
|
+
const configProvider = instance ? inject(configProviderInjectKey) : null;
|
|
21
|
+
const locale = computed(() => {
|
|
22
|
+
return configProvider?.locale || 'zh';
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const transform = (key: string, ...args: any[]): string => {
|
|
26
|
+
const lang = i18nLangs.value[locale.value];
|
|
27
|
+
const value = lang[key as keyof typeof lang];
|
|
28
|
+
|
|
29
|
+
if (isUndefined(value)) {
|
|
30
|
+
console.warn(`Cannot translate the value of keypath '${key}'`);
|
|
31
|
+
return key;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 处理变量替换
|
|
35
|
+
if (args.length > 0 && isString(value)) {
|
|
36
|
+
// 具名参数: t('x{a}x{b}', { a: v0, b: v1 })
|
|
37
|
+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null) {
|
|
38
|
+
const params = args[0];
|
|
39
|
+
return value.replace(/{(\w+)}/g, (match, name) => {
|
|
40
|
+
return params[name] ?? match;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// 位置参数: t('x{0}x{1}', v0, v1)
|
|
44
|
+
return value.replace(/{(\d+)}/g, (match, index) => {
|
|
45
|
+
return args[index] ?? match;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return value;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
locale,
|
|
54
|
+
t: transform,
|
|
55
|
+
};
|
|
56
|
+
}
|