From 4db01403aeb82634c782a405e974fd0e0b71d0f7 Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Mon, 22 May 2023 10:12:17 +0800 Subject: [PATCH] feat: add missing i18n (#130) --- web/app/components/base/emoji-picker/index.tsx | 13 +++++++------ web/i18n/lang/app.en.ts | 4 ++++ web/i18n/lang/app.zh.ts | 4 ++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/web/app/components/base/emoji-picker/index.tsx b/web/app/components/base/emoji-picker/index.tsx index 47dbeaaa5d..5c888fb94d 100644 --- a/web/app/components/base/emoji-picker/index.tsx +++ b/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 = ({ 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 = ({ : <> diff --git a/web/i18n/lang/app.en.ts b/web/i18n/lang/app.en.ts index 73c2a5b1b6..aea93eb168 100644 --- a/web/i18n/lang/app.en.ts +++ b/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 diff --git a/web/i18n/lang/app.zh.ts b/web/i18n/lang/app.zh.ts index 03fde52c35..467d85feeb 100644 --- a/web/i18n/lang/app.zh.ts +++ b/web/i18n/lang/app.zh.ts @@ -34,6 +34,10 @@ const translation = { appCreated: '应用已创建', appCreateFailed: '应用创建失败', }, + emoji: { + ok: '确认', + cancel: '取消', + } } export default translation