Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
4db01403
Unverified
Commit
4db01403
authored
May 22, 2023
by
crazywoola
Committed by
GitHub
May 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add missing i18n (#130)
parent
d8425f3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
index.tsx
web/app/components/base/emoji-picker/index.tsx
+7
-6
app.en.ts
web/i18n/lang/app.en.ts
+4
-0
app.zh.ts
web/i18n/lang/app.zh.ts
+4
-0
No files found.
web/app/components/base/emoji-picker/index.tsx
View file @
4db01403
'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
>
:
<>
...
...
web/i18n/lang/app.en.ts
View file @
4db01403
...
...
@@ -35,6 +35,10 @@ const translation = {
appCreated
:
'App created'
,
appCreateFailed
:
'Failed to create app'
,
},
emoji
:
{
ok
:
'OK'
,
cancel
:
'Cancel'
,
}
}
export
default
translation
web/i18n/lang/app.zh.ts
View file @
4db01403
...
...
@@ -34,6 +34,10 @@ const translation = {
appCreated
:
'应用已创建'
,
appCreateFailed
:
'应用创建失败'
,
},
emoji
:
{
ok
:
'确认'
,
cancel
:
'取消'
,
}
}
export
default
translation
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment