瀏覽代碼

feat: add missing i18n (#130)

tags/0.2.2
crazywoola 2 年之前
父節點
當前提交
4db01403ae
沒有連結到貢獻者的電子郵件帳戶。
共有 3 個檔案被更改,包括 15 行新增6 行删除
  1. 7
    6
      web/app/components/base/emoji-picker/index.tsx
  2. 4
    0
      web/i18n/lang/app.en.ts
  3. 4
    0
      web/i18n/lang/app.zh.ts

+ 7
- 6
web/app/components/base/emoji-picker/index.tsx 查看文件

@@ -1,18 +1,18 @@
'use client'
import React from 'react'
import { useState, FC, ChangeEvent } from 'react'
import data from '@emoji-mart/data'
import { init, SearchIndex } from 'emoji-mart'
// import AppIcon from '@/app/components/base/app-icon'
import cn from 'classnames'
import Divider from '@/app/components/base/divider'

import Button from '@/app/components/base/button'
import s from './style.module.css'
import { useState, FC, ChangeEvent } from 'react'
import {
MagnifyingGlassIcon
} from '@heroicons/react/24/outline'
import React from 'react'
import Modal from '@/app/components/base/modal'
import { useTranslation } from 'react-i18next'

declare global {
namespace JSX {
@@ -69,6 +69,7 @@ const EmojiPicker: FC<IEmojiPickerProps> = ({
onClose

}) => {
const { t } = useTranslation()
const { categories } = data as any
const [selectedEmoji, setSelectedEmoji] = useState('')
const [selectedBackground, setSelectedBackground] = useState(backgroundColors[0])
@@ -187,7 +188,7 @@ const EmojiPicker: FC<IEmojiPickerProps> = ({
<Button type="default" className='w-full' onClick={() => {
onClose && onClose()
}}>
Cancel
{t('app.emoji.cancel')}
</Button>
<Button
disabled={selectedEmoji == ''}
@@ -196,7 +197,7 @@ const EmojiPicker: FC<IEmojiPickerProps> = ({
onClick={() => {
onSelect && onSelect(selectedEmoji, selectedBackground)
}}>
OK
{t('app.emoji.ok')}
</Button>
</div>
</Modal> : <>

+ 4
- 0
web/i18n/lang/app.en.ts 查看文件

@@ -35,6 +35,10 @@ const translation = {
appCreated: 'App created',
appCreateFailed: 'Failed to create app',
},
emoji: {
ok: 'OK',
cancel: 'Cancel',
}
}

export default translation

+ 4
- 0
web/i18n/lang/app.zh.ts 查看文件

@@ -34,6 +34,10 @@ const translation = {
appCreated: '应用已创建',
appCreateFailed: '应用创建失败',
},
emoji: {
ok: '确认',
cancel: '取消',
}
}

export default translation

Loading…
取消
儲存