Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baichixing
Neos
Commits
3ed6bdd4
Commit
3ed6bdd4
authored
Jun 17, 2024
by
BBeretta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat/language-translation (prettier fixes)
parent
5390fb5e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
34 deletions
+35
-34
src/middleware/sqlite/index.ts
src/middleware/sqlite/index.ts
+3
-4
src/service/room/errorMsg.ts
src/service/room/errorMsg.ts
+1
-1
src/ui/BuildDeck/CardDetail.tsx
src/ui/BuildDeck/CardDetail.tsx
+1
-1
src/ui/BuildDeck/Filter.tsx
src/ui/BuildDeck/Filter.tsx
+2
-2
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+1
-1
src/ui/BuildDeck/store.ts
src/ui/BuildDeck/store.ts
+2
-2
src/ui/Duel/Message/PositionModal/index.tsx
src/ui/Duel/Message/PositionModal/index.tsx
+6
-7
src/ui/Duel/Message/SelectCardsModal/index.tsx
src/ui/Duel/Message/SelectCardsModal/index.tsx
+3
-1
src/ui/Duel/PlayMat/Menu/index.tsx
src/ui/Duel/PlayMat/Menu/index.tsx
+3
-3
src/ui/Duel/utils/interactTypeToStringIcon.tsx
src/ui/Duel/utils/interactTypeToStringIcon.tsx
+8
-8
src/ui/Match/CustomRoomContent/index.tsx
src/ui/Match/CustomRoomContent/index.tsx
+3
-3
src/ui/Shared/YgoCard/index.tsx
src/ui/Shared/YgoCard/index.tsx
+2
-1
No files found.
src/middleware/sqlite/index.ts
View file @
3ed6bdd4
...
...
@@ -69,7 +69,6 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
const
info
=
action
.
initInfo
;
if
(
info
)
{
const
language
=
localStorage
.
getItem
(
"
language
"
)
||
"
cn
"
;
//It currently only supports en-US, es-ES, ja-JP, ko-KR, zh-CN
if
(
language
===
"
en
"
||
...
...
@@ -82,12 +81,12 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
}
else
if
(
language
===
"
ja
"
)
{
info
.
releaseDbUrl
=
info
.
releaseDbUrl
.
replace
(
"
zh-CN
"
,
"
ja-JP
"
);
info
.
preReleaseDbUrl
=
info
.
preReleaseDbUrl
.
replace
(
"
zh-CN
"
,
"
ja-JP
"
);
}
else
if
(
language
===
"
es
"
)
{
info
.
releaseDbUrl
=
info
.
releaseDbUrl
.
replace
(
"
zh-CN
"
,
"
es-ES
"
);
info
.
preReleaseDbUrl
=
info
.
preReleaseDbUrl
.
replace
(
"
zh-CN
"
,
"
es-ES
"
);
}
else
if
(
language
===
"
ko
"
)
{
info
.
releaseDbUrl
=
info
.
releaseDbUrl
.
replace
(
"
zh-CN
"
,
"
ko-KR
"
);
info
.
preReleaseDbUrl
=
info
.
preReleaseDbUrl
.
replace
(
"
zh-CN
"
,
"
ko-KR
"
);
}
else
if
(
language
===
"
es
"
)
{
info
.
releaseDbUrl
=
info
.
releaseDbUrl
.
replace
(
"
zh-CN
"
,
"
es-ES
"
);
info
.
preReleaseDbUrl
=
info
.
preReleaseDbUrl
.
replace
(
"
zh-CN
"
,
"
es-ES
"
);
}
const
releasePromise
=
pfetch
(
info
.
releaseDbUrl
,
{
...
...
src/service/room/errorMsg.ts
View file @
3ed6bdd4
...
...
@@ -16,7 +16,7 @@ const DECKERROR_NOTAVAIL = 0x9;
const
language
=
localStorage
.
getItem
(
"
language
"
);
const
mainDeckWarining
=
language
!=
"
cn
"
language
!=
=
"
cn
"
?
"
The main deck should contain 40-60 cards.
"
:
"
主卡组数量应为40-60张
"
;
...
...
src/ui/BuildDeck/CardDetail.tsx
View file @
3ed6bdd4
import
{
Button
,
Descriptions
,
type
DescriptionsProps
}
from
"
antd
"
;
import
classNames
from
"
classnames
"
;
import
{
useEffect
,
useMemo
,
useState
}
from
"
react
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
import
{
type
CardMeta
,
fetchCard
,
fetchStrings
,
Region
}
from
"
@/api
"
;
import
{
...
...
@@ -15,7 +16,6 @@ import {
import
{
CardEffectText
,
IconFont
,
ScrollableArea
,
YgoCard
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./CardDetail.module.scss
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
export
const
CardDetail
:
React
.
FC
<
{
code
:
number
;
...
...
src/ui/BuildDeck/Filter.tsx
View file @
3ed6bdd4
...
...
@@ -68,7 +68,7 @@ export const Filter: React.FC<{
[
index
]:
value
,
},
}));
}
;
}
;
return (
<>
...
...
@@ -124,7 +124,7 @@ export const Filter: React.FC<{
{
i18n
(
"
Confirm
"
)
}
</
Button
>
<
Button
type=
"text"
onClick=
{
onCancel
}
>
{
i18n
(
"
Cancel
"
)
}
{
i18n
(
"
Cancel
"
)
}
</
Button
>
</
div
>
</>
...
...
src/ui/BuildDeck/index.tsx
View file @
3ed6bdd4
...
...
@@ -466,7 +466,7 @@ const Search: React.FC = () => {
icon=
{
<
SortAscendingOutlined
/>
}
>
<
span
>
{
i18n
(
"
SortBy
"
)
}
{
i18n
(
"
SortBy
"
)
}
<
span
className=
{
styles
[
"
search-count
"
]
}
>
(
{
searchResult
.
length
}
)
</
span
>
...
...
src/ui/BuildDeck/store.ts
View file @
3ed6bdd4
...
...
@@ -14,8 +14,8 @@ const exceedsNumberCardsSameName =
language
!==
"
cn
"
?
"
Exceeds the number of cards with the same name
"
:
"
超过同名卡
"
;
const
limitCards
=
language
!=
"
cn
"
?
"
Limit of cards
"
:
"
张的上限
"
;
const
exceedsLimit
=
language
!=
"
cn
"
?
"
Exceeds the limit
"
:
"
超过
"
;
const
limitCards
=
language
!=
=
"
cn
"
?
"
Limit of cards
"
:
"
张的上限
"
;
const
exceedsLimit
=
language
!=
=
"
cn
"
?
"
Exceeds the limit
"
:
"
超过
"
;
const
cannotAddTokens
=
language
!==
"
cn
"
?
"
Cannot add tokens
"
:
"
不能添加衍生物
"
;
...
...
src/ui/Duel/Message/PositionModal/index.tsx
View file @
3ed6bdd4
...
...
@@ -16,8 +16,8 @@ const defaultProps = { isOpen: false, positions: [] };
const
localStore
=
proxy
<
PositionModalProps
>
(
defaultProps
);
const
language
=
localStorage
.
getItem
(
'
language
'
);
const
title
=
language
!=
'
cn
'
?
'
Please select a position
'
:
'
请选择表示形式
'
;
const
language
=
localStorage
.
getItem
(
"
language
"
);
const
title
=
language
!=
"
cn
"
?
"
Please select a position
"
:
"
请选择表示形式
"
;
export
const
PositionModal
=
()
=>
{
const
{
isOpen
,
positions
}
=
useSnapshot
(
localStore
);
...
...
@@ -25,7 +25,6 @@ export const PositionModal = () => {
undefined
,
);
return
(
<
NeosModal
title=
{
title
}
...
...
@@ -65,10 +64,10 @@ export const PositionModal = () => {
};
function
cardPosition
(
position
:
ygopro
.
CardPosition
):
string
{
const
faceUpAtk
=
language
!=
'
cn
'
?
'
Face-Up Attack
'
:
"
正面攻击形式
"
;
const
faceUpDef
=
language
!=
'
cn
'
?
'
Face-Up Defense
'
:
"
正面防守形式
"
;
const
faceDownAtk
=
language
!=
'
cn
'
?
'
Face-Down Attack
'
:
"
背面攻击形式
"
;
const
faceDownDef
=
language
!=
'
cn
'
?
'
Face-Down Defense
'
:
"
背面防守形式
"
;
const
faceUpAtk
=
language
!=
=
"
cn
"
?
"
Face-Up Attack
"
:
"
正面攻击形式
"
;
const
faceUpDef
=
language
!=
=
"
cn
"
?
"
Face-Up Defense
"
:
"
正面防守形式
"
;
const
faceDownAtk
=
language
!=
=
"
cn
"
?
"
Face-Down Attack
"
:
"
背面攻击形式
"
;
const
faceDownDef
=
language
!=
=
"
cn
"
?
"
Face-Down Defense
"
:
"
背面防守形式
"
;
switch
(
position
)
{
case
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
{
...
...
src/ui/Duel/Message/SelectCardsModal/index.tsx
View file @
3ed6bdd4
...
...
@@ -110,7 +110,9 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
<>
<
span
>
{
preHintMsg
}
</
span
>
<
span
>
{
selectHintMsg
}
</
span
>
<
span
>
(
{
i18n
(
"
PleaseSelect
"
)
}
{
minMaxText
}
{
i18n
(
"
Cards
"
)
}
)
</
span
>
<
span
>
(
{
i18n
(
"
PleaseSelect
"
)
}
{
minMaxText
}
{
i18n
(
"
Cards
"
)
}
)
</
span
>
<
span
>
{
single
?
i18n
(
"
SelectOneCardAtTime
"
)
:
""
}
</
span
>
</>
}
// TODO: 这里可以再细化一些
...
...
src/ui/Duel/PlayMat/Menu/index.tsx
View file @
3ed6bdd4
...
...
@@ -140,9 +140,9 @@ export const Menu = () => {
setPhaseSwitchItems
(
newPhaseSwitchItems
);
},
[
phaseBind
]);
const
allChain
=
language
!=
"
cn
"
?
"
All Chain
"
:
""
;
const
ignoreChain
=
language
!=
"
cn
"
?
"
Ignore Chain
"
:
""
;
const
smartChain
=
language
!=
"
cn
"
?
"
Smart Chain
"
:
""
;
const
allChain
=
language
!=
=
"
cn
"
?
"
All Chain
"
:
""
;
const
ignoreChain
=
language
!=
=
"
cn
"
?
"
Ignore Chain
"
:
""
;
const
smartChain
=
language
!=
=
"
cn
"
?
"
Smart Chain
"
:
""
;
const
chainSettingTexts
=
[
[
ChainSetting
.
CHAIN_ALL
,
allChain
],
...
...
src/ui/Duel/utils/interactTypeToStringIcon.tsx
View file @
3ed6bdd4
...
...
@@ -4,16 +4,16 @@ import { IconFont } from "@/ui/Shared";
import
CardPosition
=
ygopro
.
CardPosition
;
const
language
=
localStorage
.
getItem
(
'
language
'
);
const
language
=
localStorage
.
getItem
(
"
language
"
);
export
function
interactTypeToString
(
t
:
InteractType
):
string
{
const
sSet
=
language
!=
'
cn
'
?
'
Set
'
:
'
后场放置
'
;
const
summon
=
language
!=
'
cn
'
?
'
Normal Summon
'
:
'
普通召唤
'
;
const
spSummon
=
language
!=
'
cn
'
?
'
Special Summon
'
:
'
特殊召唤
'
;
const
posChange
=
language
!=
'
cn
'
?
'
Change Position
'
:
'
改变表示形式
'
;
const
mSet
=
language
!=
'
cn
'
?
'
Set
'
:
'
前场放置
'
;
const
activate
=
language
!=
'
cn
'
?
'
Activate
'
:
'
发动效果
'
;
const
attack
=
language
!=
'
cn
'
?
'
Attack
'
:
'
攻击
'
;
const
sSet
=
language
!=
=
"
cn
"
?
"
Set
"
:
"
后场放置
"
;
const
summon
=
language
!=
=
"
cn
"
?
"
Normal Summon
"
:
"
普通召唤
"
;
const
spSummon
=
language
!=
=
"
cn
"
?
"
Special Summon
"
:
"
特殊召唤
"
;
const
posChange
=
language
!=
=
"
cn
"
?
"
Change Position
"
:
"
改变表示形式
"
;
const
mSet
=
language
!=
=
"
cn
"
?
"
Set
"
:
"
前场放置
"
;
const
activate
=
language
!=
=
"
cn
"
?
"
Activate
"
:
"
发动效果
"
;
const
attack
=
language
!=
=
"
cn
"
?
"
Attack
"
:
"
攻击
"
;
switch
(
t
)
{
case
InteractType
.
SUMMON
:
...
...
src/ui/Match/CustomRoomContent/index.tsx
View file @
3ed6bdd4
...
...
@@ -2,6 +2,7 @@ import { CopyOutlined, KeyOutlined } from "@ant-design/icons";
import
type
{
CheckboxProps
}
from
"
antd
"
;
import
{
App
,
Button
,
Checkbox
,
Input
}
from
"
antd
"
;
import
React
,
{
ChangeEvent
,
useEffect
}
from
"
react
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
defaultOptions
,
getPrivateRoomID
,
Options
}
from
"
@/api
"
;
...
...
@@ -9,7 +10,6 @@ import { accountStore } from "@/stores";
import
{
Select
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./index.module.scss
"
;
import
{
useTranslation
}
from
"
react-i18next
"
;
interface
CustomRoomProps
{
options
:
Options
;
...
...
@@ -205,10 +205,10 @@ export const CustomRoomFooter: React.FC<{
return
(
<
div
className=
{
styles
.
footer
}
>
<
Button
className=
{
styles
.
btn
}
onClick=
{
onCreateRoom
}
>
{
i18n
(
"
CreatePrivateRoom
"
)
}
{
i18n
(
"
CreatePrivateRoom
"
)
}
</
Button
>
<
Button
className=
{
styles
.
btn
}
onClick=
{
onJoinRoom
}
>
{
i18n
(
"
JoinPrivateRoom
"
)
}
{
i18n
(
"
JoinPrivateRoom
"
)
}
</
Button
>
</
div
>
);
...
...
src/ui/Shared/YgoCard/index.tsx
View file @
3ed6bdd4
...
...
@@ -71,7 +71,8 @@ export function getCardImgUrl(code: number, back = false) {
language
===
"
en
"
||
language
===
"
br
"
||
language
===
"
pt
"
||
language
===
"
fr
"
language
===
"
fr
"
||
language
===
"
es
"
)
{
NeosConfig
.
releaseImgUrl
=
NeosConfig
.
releaseImgUrl
.
replace
(
"
zh-CN
"
,
...
...
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