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
66782ef1
Unverified
Commit
66782ef1
authored
May 25, 2023
by
Joel
Committed by
GitHub
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: title support i18n (#212)
parent
fb7f509e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
4 deletions
+10
-4
Apps.tsx
web/app/(commonLayout)/apps/Apps.tsx
+3
-0
page.tsx
web/app/(commonLayout)/apps/page.tsx
+0
-4
index.tsx
web/app/components/explore/index.tsx
+3
-0
app.en.ts
web/i18n/lang/app.en.ts
+1
-0
app.zh.ts
web/i18n/lang/app.zh.ts
+1
-0
explore.en.ts
web/i18n/lang/explore.en.ts
+1
-0
explore.zh.ts
web/i18n/lang/explore.zh.ts
+1
-0
No files found.
web/app/(commonLayout)/apps/Apps.tsx
View file @
66782ef1
...
...
@@ -9,6 +9,7 @@ import { AppListResponse } from '@/models/app'
import
{
fetchAppList
}
from
'@/service/apps'
import
{
useSelector
}
from
'@/context/app-context'
import
{
NEED_REFRESH_APP_LIST_KEY
}
from
'@/config'
import
{
useTranslation
}
from
'react-i18next'
const
getKey
=
(
pageIndex
:
number
,
previousPageData
:
AppListResponse
)
=>
{
if
(
!
pageIndex
||
previousPageData
.
has_more
)
...
...
@@ -17,12 +18,14 @@ const getKey = (pageIndex: number, previousPageData: AppListResponse) => {
}
const
Apps
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
{
data
,
isLoading
,
setSize
,
mutate
}
=
useSWRInfinite
(
getKey
,
fetchAppList
,
{
revalidateFirstPage
:
false
})
const
loadingStateRef
=
useRef
(
false
)
const
pageContainerRef
=
useSelector
(
state
=>
state
.
pageContainerRef
)
const
anchorRef
=
useRef
<
HTMLAnchorElement
>
(
null
)
useEffect
(()
=>
{
document
.
title
=
`
${
t
(
'app.title'
)}
- Dify`
;
if
(
localStorage
.
getItem
(
NEED_REFRESH_APP_LIST_KEY
)
===
'1'
)
{
localStorage
.
removeItem
(
NEED_REFRESH_APP_LIST_KEY
)
mutate
()
...
...
web/app/(commonLayout)/apps/page.tsx
View file @
66782ef1
...
...
@@ -29,8 +29,4 @@ const AppList = async () => {
)
}
export
const
metadata
=
{
title
:
'Apps - Dify'
,
}
export
default
AppList
web/app/components/explore/index.tsx
View file @
66782ef1
...
...
@@ -5,6 +5,7 @@ import Sidebar from '@/app/components/explore/sidebar'
import
{
useAppContext
}
from
'@/context/app-context'
import
{
fetchMembers
}
from
'@/service/common'
import
{
InstalledApp
}
from
'@/models/explore'
import
{
useTranslation
}
from
'react-i18next'
export
interface
IExploreProps
{
children
:
React
.
ReactNode
...
...
@@ -13,12 +14,14 @@ export interface IExploreProps {
const
Explore
:
FC
<
IExploreProps
>
=
({
children
})
=>
{
const
{
t
}
=
useTranslation
()
const
[
controlUpdateInstalledApps
,
setControlUpdateInstalledApps
]
=
useState
(
0
)
const
{
userProfile
}
=
useAppContext
()
const
[
hasEditPermission
,
setHasEditPermission
]
=
useState
(
false
)
const
[
installedApps
,
setInstalledApps
]
=
useState
<
InstalledApp
[]
>
([])
useEffect
(()
=>
{
document
.
title
=
`
${
t
(
'explore.title'
)}
- Dify`
;
(
async
()
=>
{
const
{
accounts
}
=
await
fetchMembers
({
url
:
'/workspaces/current/members'
,
params
:
{}})
if
(
!
accounts
)
return
...
...
web/i18n/lang/app.en.ts
View file @
66782ef1
const
translation
=
{
title
:
'Apps'
,
createApp
:
'Create new App'
,
modes
:
{
completion
:
'Text Generator'
,
...
...
web/i18n/lang/app.zh.ts
View file @
66782ef1
const
translation
=
{
title
:
'应用'
,
createApp
:
'创建应用'
,
modes
:
{
completion
:
'文本生成型'
,
...
...
web/i18n/lang/explore.en.ts
View file @
66782ef1
const
translation
=
{
title
:
'My Apps'
,
sidebar
:
{
discovery
:
'Discovery'
,
workspace
:
'Workspace'
,
...
...
web/i18n/lang/explore.zh.ts
View file @
66782ef1
const
translation
=
{
title
:
'我的应用'
,
sidebar
:
{
discovery
:
'发现'
,
workspace
:
'工作区'
,
...
...
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