Skip to content

Commit e9ceeee

Browse files
author
Yash Agrawal
committed
feat: add localization for add your thoughts...
1 parent f4b0d0e commit e9ceeee

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/Page/Posts/Comment.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ import {
66
encode,
77
type ClubsProfile,
88
} from '@devprotocol/clubs-core'
9-
import { ref } from 'vue'
9+
import { ref, onMounted } from 'vue'
1010
import Profile from '../../Common/Profile.vue'
1111
import type { Comment, CommentPrimitives } from '../../../types'
1212
import IconSend from '../../../assets/images/icon-send.svg'
1313
import IconTrash from '../../../assets/images/icon-trash.svg'
1414
import { getSignature, getMessage } from '../../../fixtures/session'
1515
import DOMPurify from 'dompurify'
1616
import { marked } from 'marked'
17+
import { i18nFactory } from '@devprotocol/clubs-core'
18+
19+
import { Strings } from './i18n'
20+
21+
const i18nBase = i18nFactory(Strings)
22+
let i18n = ref<ReturnType<typeof i18nBase>>(i18nBase(['en']))
1723
1824
type Props = {
1925
feedId: string
@@ -201,6 +207,10 @@ const deleteComment = async (commentId: string) => {
201207
}
202208
}
203209
}
210+
211+
onMounted(() => {
212+
i18n.value = i18nBase(navigator.languages)
213+
})
204214
</script>
205215

206216
<template>
@@ -253,7 +263,7 @@ const deleteComment = async (commentId: string) => {
253263
class="w-11/12 bg-transparent rounded border border-gray-400 px-2 py-2 text-base text-gray-700 focus:border-indigo-500 focus:outline-none"
254264
type="text"
255265
v-model="newComment"
256-
placeholder="Add your thoughts..."
266+
:placeholder="i18n('AddYourThoughts')"
257267
:disabled="isCommenting"
258268
/>
259269
<button

src/components/Page/Posts/i18n/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ClubsI18nParts } from '@devprotocol/clubs-core'
22

33
export const Strings = {
4+
AddYourThoughts: { en: 'Add your thoughts...', ja: 'コメントを入力' },
45
Post: { en: 'Post', ja: '投稿する' },
56
Title: { en: 'Title', ja: '件名' },
67
WhatsHappening: { en: "What's happening", ja: '本文' },

0 commit comments

Comments
 (0)