|
1 | 1 | <script setup lang="ts">
|
2 |
| -import { nextTick, onMounted, onUnmounted, ref, toRefs, watch } from 'vue' |
| 2 | +import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue' |
3 | 3 | import {
|
4 | 4 | onPostCreated,
|
5 | 5 | onUpdate,
|
6 | 6 | } from '@devprotocol/clubs-plugin-posts/plugin-helper'
|
7 | 7 | import type { Poll } from '../../types.ts'
|
| 8 | +import { Strings } from '../i18n' |
| 9 | +import { i18nFactory } from '@devprotocol/clubs-core' |
| 10 | +
|
| 11 | +const i18nBase = i18nFactory(Strings) |
| 12 | +let i18n = i18nBase(['en']) |
8 | 13 |
|
9 | 14 | type Choice = {
|
10 | 15 | id: number
|
@@ -87,6 +92,7 @@ const togglePollState = () => {
|
87 | 92 | }
|
88 | 93 |
|
89 | 94 | onMounted(() => {
|
| 95 | + i18n = i18nBase(navigator.languages) |
90 | 96 | window.addEventListener(POLL_EVENT, togglePollState)
|
91 | 97 | })
|
92 | 98 |
|
@@ -169,7 +175,7 @@ watch(isPollOpen, (isOpen) => {
|
169 | 175 | </div>
|
170 | 176 | <div class="py-4 px-4 border-t border-gray-400">
|
171 | 177 | <p class="mb-2 text-gray-400 font-bold">
|
172 |
| - Immediate Result Publication Settings |
| 178 | + {{ i18n('ImmediateResultPublicationSettings') }} |
173 | 179 | </p>
|
174 | 180 | <label class="relative inline-flex items-center cursor-pointer">
|
175 | 181 | <input v-model="publication" type="checkbox" class="sr-only peer" />
|
@@ -263,7 +269,7 @@ watch(isPollOpen, (isOpen) => {
|
263 | 269 | class="py-4 w-full border text-red-500"
|
264 | 270 | @click="handleClickRemovePoll"
|
265 | 271 | >
|
266 |
| - Remove poll |
| 272 | + {{ i18n('RemovePoll') }} |
267 | 273 | </button>
|
268 | 274 | </div>
|
269 | 275 | </div>
|
|
0 commit comments