Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1ab86bc9
authored
Oct 29, 2025
by
Calcium-Ion
Committed by
GitHub
Oct 29, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(language): add Japanese language support to LanguageSelector and i18n configuration (#2131)
parent
5d127557
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
web/src/components/layout/headerbar/LanguageSelector.jsx
+10
-1
web/src/i18n/i18n.js
+2
-0
No files found.
web/src/components/layout/headerbar/LanguageSelector.jsx
View file @
1ab86bc9
...
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
...
@@ -20,7 +20,7 @@ For commercial licensing, please contact support@quantumnous.com
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Button
,
Dropdown
}
from
'@douyinfe/semi-ui'
;
import
{
Button
,
Dropdown
}
from
'@douyinfe/semi-ui'
;
import
{
Languages
}
from
'lucide-react'
;
import
{
Languages
}
from
'lucide-react'
;
import
{
CN
,
GB
,
FR
,
RU
}
from
'country-flag-icons/react/3x2'
;
import
{
CN
,
GB
,
FR
,
RU
,
JP
}
from
'country-flag-icons/react/3x2'
;
const
LanguageSelector
=
({
currentLang
,
onLanguageChange
,
t
})
=>
{
const
LanguageSelector
=
({
currentLang
,
onLanguageChange
,
t
})
=>
{
return
(
return
(
...
@@ -28,6 +28,7 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
...
@@ -28,6 +28,7 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
position=
'bottomRight'
position=
'bottomRight'
render=
{
render=
{
<
Dropdown
.
Menu
className=
'!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600'
>
<
Dropdown
.
Menu
className=
'!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600'
>
{
/* Language sorting: Order by English name (Chinese, English, French, Japanese, Russian) */
}
<
Dropdown
.
Item
<
Dropdown
.
Item
onClick=
{
()
=>
onLanguageChange
(
'zh'
)
}
onClick=
{
()
=>
onLanguageChange
(
'zh'
)
}
className=
{
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'zh' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`
}
className=
{
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'zh' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`
}
...
@@ -50,6 +51,14 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
...
@@ -50,6 +51,14 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
<
span
>
Français
</
span
>
<
span
>
Français
</
span
>
</
Dropdown
.
Item
>
</
Dropdown
.
Item
>
<
Dropdown
.
Item
<
Dropdown
.
Item
onClick=
{
()
=>
onLanguageChange
(
'ja'
)
}
className=
{
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ja' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`
}
>
{
/* Japanese flag using emoji as country-flag-icons/react/3x2 does not export JP */
}
<
JP
title=
'日本語'
className=
'!w-5 !h-auto'
/>
<
span
>
日本語
</
span
>
</
Dropdown
.
Item
>
<
Dropdown
.
Item
onClick=
{
()
=>
onLanguageChange
(
'ru'
)
}
onClick=
{
()
=>
onLanguageChange
(
'ru'
)
}
className=
{
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ru' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`
}
className=
{
`!flex !items-center !gap-2 !px-3 !py-1.5 !text-sm !text-semi-color-text-0 dark:!text-gray-200 ${currentLang === 'ru' ? '!bg-semi-color-primary-light-default dark:!bg-blue-600 !font-semibold' : 'hover:!bg-semi-color-fill-1 dark:hover:!bg-gray-600'}`
}
>
>
...
...
web/src/i18n/i18n.js
View file @
1ab86bc9
...
@@ -25,6 +25,7 @@ import enTranslation from './locales/en.json';
...
@@ -25,6 +25,7 @@ import enTranslation from './locales/en.json';
import
frTranslation
from
'./locales/fr.json'
;
import
frTranslation
from
'./locales/fr.json'
;
import
zhTranslation
from
'./locales/zh.json'
;
import
zhTranslation
from
'./locales/zh.json'
;
import
ruTranslation
from
'./locales/ru.json'
;
import
ruTranslation
from
'./locales/ru.json'
;
import
jaTranslation
from
'./locales/ja.json'
;
i18n
i18n
.
use
(
LanguageDetector
)
.
use
(
LanguageDetector
)
...
@@ -36,6 +37,7 @@ i18n
...
@@ -36,6 +37,7 @@ i18n
zh
:
zhTranslation
,
zh
:
zhTranslation
,
fr
:
frTranslation
,
fr
:
frTranslation
,
ru
:
ruTranslation
,
ru
:
ruTranslation
,
ja
:
jaTranslation
,
},
},
fallbackLng
:
'zh'
,
fallbackLng
:
'zh'
,
interpolation
:
{
interpolation
:
{
...
...
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