Commit 80d42997 authored by BBeretta's avatar BBeretta

feat/language-translation (Replay, Text updates, ChatBox, WaitRoom)

parent 6aafbde0
Pipeline #27512 failed with stages
in 9 minutes and 25 seconds
...@@ -6,6 +6,7 @@ import { proxy, useSnapshot } from "valtio"; ...@@ -6,6 +6,7 @@ import { proxy, useSnapshot } from "valtio";
import { IconFont, ScrollableArea, useChat } from "@/ui/Shared"; import { IconFont, ScrollableArea, useChat } from "@/ui/Shared";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import { useTranslation } from "react-i18next";
const store = proxy({ open: false }); const store = proxy({ open: false });
...@@ -17,7 +18,7 @@ interface ChatItem { ...@@ -17,7 +18,7 @@ interface ChatItem {
export const ChatBox: React.FC = () => { export const ChatBox: React.FC = () => {
const { open } = useSnapshot(store); const { open } = useSnapshot(store);
const { dialogs, input, setInput, ref, onSend } = useChat(true); const { dialogs, input, setInput, ref, onSend } = useChat(true);
const { t: i18n } = useTranslation("Chat");
const onClose = () => (store.open = false); const onClose = () => (store.open = false);
return ( return (
...@@ -42,7 +43,7 @@ export const ChatBox: React.FC = () => { ...@@ -42,7 +43,7 @@ export const ChatBox: React.FC = () => {
value={input} value={input}
onChange={(event) => setInput(event.target.value)} onChange={(event) => setInput(event.target.value)}
autoSize autoSize
placeholder="请输入聊天内容" placeholder={i18n("PleaseEnterChatContent")}
onPressEnter={(e) => { onPressEnter={(e) => {
e.preventDefault(); e.preventDefault();
onSend(); onSend();
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"Match": "Match", "Match": "Match",
"DeckBuilding": "Montagem de baralho", "DeckBuilding": "Montagem de baralho",
"PersonalCenter": "Centro pessoal", "PersonalCenter": "Centro pessoal",
"MyCardCommunity": "Comunidade Mengka", "MyCardCommunity": "Comunidade MyCard",
"DuelDatabase": "Base de dados de duelos", "DuelDatabase": "Base de dados de duelos",
"LogOut": "Sair", "LogOut": "Sair",
"Login": "Entrar no Mengka", "Login": "Entrar no MyCard",
"Fullscreen": "Tela cheia" "Fullscreen": "Tela cheia"
}, },
"Start": { "Start": {
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
"MCCompetitiveMatchmakingDesc": "Lute ferozmente com dezenas de milhares de outros jogadores na escada do MyCard, visando ser o mais forte. Liquidação às 22:00 do último dia de cada mês, anúncio de classificação e distribuição de recompensas.", "MCCompetitiveMatchmakingDesc": "Lute ferozmente com dezenas de milhares de outros jogadores na escada do MyCard, visando ser o mais forte. Liquidação às 22:00 do último dia de cada mês, anúncio de classificação e distribuição de recompensas.",
"MCCasualMatchmakingTitle": "Duelo Casual", "MCCasualMatchmakingTitle": "Duelo Casual",
"MCCasualMatchmakingDesc": "Por enquanto, deixe de lado as vitórias e as derrotas e aproveite a diversão dos duelos. Os 20 decks mais usados no combate competitivo durante a última semana serão temporariamente desativados.", "MCCasualMatchmakingDesc": "Por enquanto, deixe de lado as vitórias e as derrotas e aproveite a diversão dos duelos. Os 20 decks mais usados no combate competitivo durante a última semana serão temporariamente desativados.",
"MCCustomRoomTitle": "Sala Personalizada", "MCCustomRoomTitle": "MyCard Sala Personalizada",
"MCCustomRoomDesc": "Crie ou entre em salas personalizadas no servidor e batalhe com amigos.", "MCCustomRoomDesc": "Crie ou entre em salas personalizadas no MyCard servidor e batalhe com amigos.",
"MCSpectatorListTitle": "Lista de espectadores", "MCSpectatorListTitle": "Lista de espectadores",
"MCSpectatorListDesc": "Assista aos duelos atualmente em andamento no Mengka MyCard.", "MCSpectatorListDesc": "Assista aos duelos atualmente em andamento no MyCard MyCard.",
"SinglePlayerModeTitle": "Modo de um jogador", "SinglePlayerModeTitle": "Modo de um jogador",
"SinglePlayerModeDesc": "Inicie um duelo contra a IA no servidor Koishi 7210 para testar seu deck ou apenas passar o tempo.", "SinglePlayerModeDesc": "Inicie um duelo contra a IA no servidor Koishi 7210 para testar seu deck ou apenas passar o tempo.",
"CustomRoomTitle": "Sala Personalizada", "CustomRoomTitle": "Sala Personalizada",
......
...@@ -150,5 +150,23 @@ ...@@ -150,5 +150,23 @@
"ClickOrDragFilesHereToUpload": "单击或拖动文件到此区域进行上传", "ClickOrDragFilesHereToUpload": "单击或拖动文件到此区域进行上传",
"SupportsYdkExtension": "仅支持后缀名为ydk的卡组文件。", "SupportsYdkExtension": "仅支持后缀名为ydk的卡组文件。",
"UnableToReadClipboardContent": "无法读取剪贴板内容:" "UnableToReadClipboardContent": "无法读取剪贴板内容:"
},
"Chat": {
"PleaseEnterChatContent": "请输入聊天内容"
},
"MatchModal": {
"PleaseEnterCustomRoomInformation": "请输入自定义房间信息",
"Server": "服务器",
"KoishiServer": "Koishi服",
"UltraPreemptiveServer": "超先行服",
"PlayerNickname": "玩家昵称",
"RoomPasswordOptional": "房间密码(可选)"
},
"ReplayModal": {
"SelectReplay": "选择回放",
"ClickOrDragFilesHereToUpload": "单击或拖动文件到此区域进行上传",
"SupportsYrd3dExtension": "仅支持后缀名为yrp3d的录像文件。",
"StartReplay": "开始回放",
"PleaseUploadReplayFile": "请先上传录像文件"
} }
} }
\ No newline at end of file
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"Match": "Match", "Match": "Match",
"DeckBuilding": "Deck Building", "DeckBuilding": "Deck Building",
"PersonalCenter": "Personal Center", "PersonalCenter": "Personal Center",
"MyCardCommunity": "Mengka Community", "MyCardCommunity": "MyCard Community",
"DuelDatabase": "Duel Database", "DuelDatabase": "Duel Database",
"LogOut": "Log out", "LogOut": "Log out",
"Login": "Login to Mengka", "Login": "Login to MyCard",
"Fullscreen": "Fullscreen" "Fullscreen": "Fullscreen"
}, },
"Start": { "Start": {
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
"MCCompetitiveMatchmakingDesc": "Battle fiercely with tens of thousands of other players on MyCard ladder, aiming to be the strongest. Settlement at 22:00 on the last day of each month, ranking announcement and rewards distribution.", "MCCompetitiveMatchmakingDesc": "Battle fiercely with tens of thousands of other players on MyCard ladder, aiming to be the strongest. Settlement at 22:00 on the last day of each month, ranking announcement and rewards distribution.",
"MCCasualMatchmakingTitle": "Casual Matchmaking", "MCCasualMatchmakingTitle": "Casual Matchmaking",
"MCCasualMatchmakingDesc": "Set aside wins and losses for now, and enjoy the fun of dueling. The top 20 most used decks in competitive matchmaking over the past week will be temporarily disabled.", "MCCasualMatchmakingDesc": "Set aside wins and losses for now, and enjoy the fun of dueling. The top 20 most used decks in competitive matchmaking over the past week will be temporarily disabled.",
"MCCustomRoomTitle": "Custom Room", "MCCustomRoomTitle": "MyCard Custom Room",
"MCCustomRoomDesc": "Create or join custom rooms on MC server and battle with friends.", "MCCustomRoomDesc": "Create or join custom rooms on MC server and battle with friends.",
"MCSpectatorListTitle": "Spectator List", "MCSpectatorListTitle": "Spectator List",
"MCSpectatorListDesc": "Watch the duels currently taking place on Mengka MyCard.", "MCSpectatorListDesc": "Watch the duels currently taking place on MyCard MyCard.",
"SinglePlayerModeTitle": "Single Player Mode", "SinglePlayerModeTitle": "Single Player Mode",
"SinglePlayerModeDesc": "Start a duel against AI on Koishi 7210 server to test your deck or just pass the time.", "SinglePlayerModeDesc": "Start a duel against AI on Koishi 7210 server to test your deck or just pass the time.",
"CustomRoomTitle": "Custom Room", "CustomRoomTitle": "Custom Room",
...@@ -150,5 +150,23 @@ ...@@ -150,5 +150,23 @@
"ClickOrDragFilesHereToUpload": "Click or drag files here to upload", "ClickOrDragFilesHereToUpload": "Click or drag files here to upload",
"SupportsYdkExtension": "Only supports deck files with the .ydk extension.", "SupportsYdkExtension": "Only supports deck files with the .ydk extension.",
"UnableToReadClipboardContent": "Unable to read clipboard content." "UnableToReadClipboardContent": "Unable to read clipboard content."
},
"Chat": {
"PleaseEnterChatContent": "Please enter chat"
},
"MatchModal": {
"PleaseEnterCustomRoomInformation": "Please enter custom room information",
"Server": "Server",
"KoishiServer": "Koishi Server",
"UltraPreemptiveServer": "Ultra Preemptive Server",
"PlayerNickname": "Player Nickname",
"RoomPasswordOptional": "Room Password (optional)"
},
"ReplayModal": {
"SelectReplay": "Select Replay",
"ClickOrDragFilesHereToUpload": "Click or drag files here to upload",
"SupportsYrd3dExtension": "Only replay files with the .yrp3d extension are supported.",
"StartReplay": "Start Replay",
"PleaseUploadReplayFile": "Please upload the replay file first."
} }
} }
\ No newline at end of file
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"Match": "Correspondance", "Match": "Correspondance",
"DeckBuilding": "Construction de Deck", "DeckBuilding": "Construction de Deck",
"PersonalCenter": "Centre personnel", "PersonalCenter": "Centre personnel",
"MyCardCommunity": "Communauté Mengka", "MyCardCommunity": "Communauté MyCard",
"DuelDatabase": "Base de données de duels", "DuelDatabase": "Base de données de duels",
"LogOut": "Déconnexion", "LogOut": "Déconnexion",
"Login": "Connexion à Mengka", "Login": "Connexion à MyCard",
"Fullscreen": "Plein écran" "Fullscreen": "Plein écran"
}, },
"Start": { "Start": {
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"MCCustomRoomTitle": "Salle personnalisée MC", "MCCustomRoomTitle": "Salle personnalisée MC",
"MCCustomRoomDesc": "Créez ou rejoignez des salles personnalisées sur le serveur MC et affrontez vos amis.", "MCCustomRoomDesc": "Créez ou rejoignez des salles personnalisées sur le serveur MC et affrontez vos amis.",
"MCSpectatorListTitle": "Liste des spectateurs", "MCSpectatorListTitle": "Liste des spectateurs",
"MCSpectatorListDesc": "Regardez les duels en cours sur Mengka MyCard.", "MCSpectatorListDesc": "Regardez les duels en cours sur MyCard MyCard.",
"SinglePlayerModeTitle": "Mode solo", "SinglePlayerModeTitle": "Mode solo",
"SinglePlayerModeDesc": "Démarrez un duel contre l'IA sur le serveur Koishi 7210 pour tester votre deck ou juste passer le temps.", "SinglePlayerModeDesc": "Démarrez un duel contre l'IA sur le serveur Koishi 7210 pour tester votre deck ou juste passer le temps.",
"CustomRoomTitle": "Salle personnalisée", "CustomRoomTitle": "Salle personnalisée",
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"MCCustomRoomTitle": "MCカスタムルーム", "MCCustomRoomTitle": "MCカスタムルーム",
"MCCustomRoomDesc": "MCサーバーでカスタムルームを作成または参加し、友達と対戦しましょう。", "MCCustomRoomDesc": "MCサーバーでカスタムルームを作成または参加し、友達と対戦しましょう。",
"MCSpectatorListTitle": "MC観戦リスト", "MCSpectatorListTitle": "MC観戦リスト",
"MCSpectatorListDesc": "Mengka MyCardで現在進行中のデュエルを観戦しましょう。", "MCSpectatorListDesc": "MyCard MyCardで現在進行中のデュエルを観戦しましょう。",
"SinglePlayerModeTitle": "シングルプレイヤーモード", "SinglePlayerModeTitle": "シングルプレイヤーモード",
"SinglePlayerModeDesc": "Koishi 7210サーバーでAIとのデュエルを開始し、自分のデッキをテストしたり、ただ時間を潰したりします。", "SinglePlayerModeDesc": "Koishi 7210サーバーでAIとのデュエルを開始し、自分のデッキをテストしたり、ただ時間を潰したりします。",
"CustomRoomTitle": "カスタムルーム", "CustomRoomTitle": "カスタムルーム",
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"Match": "Match", "Match": "Match",
"DeckBuilding": "Montagem de baralho", "DeckBuilding": "Montagem de baralho",
"PersonalCenter": "Centro pessoal", "PersonalCenter": "Centro pessoal",
"MyCardCommunity": "Comunidade Mengka", "MyCardCommunity": "Comunidade MyCard",
"DuelDatabase": "Base de dados de duelos", "DuelDatabase": "Base de dados de duelos",
"LogOut": "Terminar sessão", "LogOut": "Terminar sessão",
"Login": "Iniciar sessão no Mengka", "Login": "Iniciar sessão no MyCard",
"Fullscreen": "Ecrã completo" "Fullscreen": "Ecrã completo"
}, },
"Start": { "Start": {
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"MCCustomRoomTitle": "Sala Personalizada", "MCCustomRoomTitle": "Sala Personalizada",
"MCCustomRoomDesc": "Crie ou entre em salas personalizadas no servidor e batalhe com amigos.", "MCCustomRoomDesc": "Crie ou entre em salas personalizadas no servidor e batalhe com amigos.",
"MCSpectatorListTitle": "Lista de espectadores", "MCSpectatorListTitle": "Lista de espectadores",
"MCSpectatorListDesc": "Assista aos duelos atualmente em andamento no Mengka MyCard.", "MCSpectatorListDesc": "Assista aos duelos atualmente em andamento no MyCard MyCard.",
"SinglePlayerModeTitle": "Modo de um jogador", "SinglePlayerModeTitle": "Modo de um jogador",
"SinglePlayerModeDesc": "Inicia um duelo contra a IA no servidor Koishi 7210 para testar o teu deck ou apenas passar o tempo.", "SinglePlayerModeDesc": "Inicia um duelo contra a IA no servidor Koishi 7210 para testar o teu deck ou apenas passar o tempo.",
"CustomRoomTitle": "Sala Personalizada", "CustomRoomTitle": "Sala Personalizada",
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"Match": "Emparejamiento", "Match": "Emparejamiento",
"DeckBuilding": "Construcción de Mazo", "DeckBuilding": "Construcción de Mazo",
"PersonalCenter": "Centro personal", "PersonalCenter": "Centro personal",
"MyCardCommunity": "Comunidad Mengka", "MyCardCommunity": "Comunidad MyCard",
"DuelDatabase": "Base de datos de duelos", "DuelDatabase": "Base de datos de duelos",
"LogOut": "Cerrar sesión", "LogOut": "Cerrar sesión",
"Login": "Iniciar sesión en Mengka", "Login": "Iniciar sesión en MyCard",
"Fullscreen": "Pantalla completa" "Fullscreen": "Pantalla completa"
}, },
"Start": { "Start": {
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"MCCustomRoomTitle": "Sala personalizada", "MCCustomRoomTitle": "Sala personalizada",
"MCCustomRoomDesc": "Crea o únete a salas personalizadas en el servidor y juega con amigos.", "MCCustomRoomDesc": "Crea o únete a salas personalizadas en el servidor y juega con amigos.",
"MCSpectatorListTitle": "Lista de espectadores", "MCSpectatorListTitle": "Lista de espectadores",
"MCSpectatorListDesc": "Observa los duelos que se están llevando a cabo en Mengka MyCard.", "MCSpectatorListDesc": "Observa los duelos que se están llevando a cabo en MyCard MyCard.",
"SinglePlayerModeTitle": "Modo un jugador", "SinglePlayerModeTitle": "Modo un jugador",
"SinglePlayerModeDesc": "Inicia un duelo contra la IA en el servidor Koishi 7210 para probar tu mazo o simplemente pasar el tiempo.", "SinglePlayerModeDesc": "Inicia un duelo contra la IA en el servidor Koishi 7210 para probar tu mazo o simplemente pasar el tiempo.",
"CustomRoomTitle": "Sala personalizada", "CustomRoomTitle": "Sala personalizada",
......
...@@ -25,6 +25,9 @@ const resources = { ...@@ -25,6 +25,9 @@ const resources = {
CustomRoomContent: translationChinese.CustomRoomContent, CustomRoomContent: translationChinese.CustomRoomContent,
WatchContent: translationChinese.WatchContent, WatchContent: translationChinese.WatchContent,
DeckSelect: translationChinese.DeckSelect, DeckSelect: translationChinese.DeckSelect,
Chat: translationChinese.Chat,
MatchModal: translationChinese.MatchModal,
ReplayModal: translationChinese.ReplayModal,
}, },
en: { en: {
Header: translationEnglish.Header, Header: translationEnglish.Header,
...@@ -37,6 +40,9 @@ const resources = { ...@@ -37,6 +40,9 @@ const resources = {
CustomRoomContent: translationEnglish.CustomRoomContent, CustomRoomContent: translationEnglish.CustomRoomContent,
WatchContent: translationEnglish.WatchContent, WatchContent: translationEnglish.WatchContent,
DeckSelect: translationEnglish.DeckSelect, DeckSelect: translationEnglish.DeckSelect,
Chat: translationEnglish.Chat,
MatchModal: translationEnglish.MatchModal,
ReplayModal: translationEnglish.ReplayModal,
}, },
es: { es: {
Header: translationSpanish.Header, Header: translationSpanish.Header,
......
...@@ -9,6 +9,7 @@ import { Select } from "@/ui/Shared"; ...@@ -9,6 +9,7 @@ import { Select } from "@/ui/Shared";
import { connectSrvpro } from "../util"; import { connectSrvpro } from "../util";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import { useTranslation } from "react-i18next";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
const serverConfig = NeosConfig.servers; const serverConfig = NeosConfig.servers;
...@@ -41,6 +42,7 @@ export const MatchModal: React.FC = ({}) => { ...@@ -41,6 +42,7 @@ export const MatchModal: React.FC = ({}) => {
const [serverId, setServerId] = useState(0); const [serverId, setServerId] = useState(0);
const [confirmLoading, setConfirmLoading] = useState(false); const [confirmLoading, setConfirmLoading] = useState(false);
const navigate = useNavigate(); const navigate = useNavigate();
const { t: i18n } = useTranslation("MatchModal");
const handlePlayerChange = (event: ChangeEvent<HTMLInputElement>) => { const handlePlayerChange = (event: ChangeEvent<HTMLInputElement>) => {
setPlayer(event.target.value); setPlayer(event.target.value);
...@@ -87,7 +89,7 @@ export const MatchModal: React.FC = ({}) => { ...@@ -87,7 +89,7 @@ export const MatchModal: React.FC = ({}) => {
return ( return (
<Modal <Modal
open={open} open={open}
title="请输入自定义房间信息" title={i18n("PleaseEnterCustomRoomInformation")}
onCancel={() => (matchStore.open = false)} onCancel={() => (matchStore.open = false)}
footer={ footer={
<Button onClick={handleSubmit} loading={confirmLoading}> <Button onClick={handleSubmit} loading={confirmLoading}>
...@@ -100,16 +102,16 @@ export const MatchModal: React.FC = ({}) => { ...@@ -100,16 +102,16 @@ export const MatchModal: React.FC = ({}) => {
<div className={styles["inputs-container"]}> <div className={styles["inputs-container"]}>
<Select <Select
className={styles.select} className={styles.select}
title="服务器" title={i18n("Server")}
value={serverId} value={serverId}
options={[ options={[
{ {
value: KOISHI_INDEX, value: KOISHI_INDEX,
label: "Koishi服", label: i18n("KoishiServer"),
}, },
{ {
value: PRERELEASE_INDEX, value: PRERELEASE_INDEX,
label: "超先行服", label: i18n("UltraPreemptiveServer"),
}, },
]} ]}
onChange={handleServerChange} onChange={handleServerChange}
...@@ -117,7 +119,7 @@ export const MatchModal: React.FC = ({}) => { ...@@ -117,7 +119,7 @@ export const MatchModal: React.FC = ({}) => {
<Input <Input
className={styles.input} className={styles.input}
type="text" type="text"
placeholder="玩家昵称" placeholder={i18n("PlayerNickname")}
value={player} value={player}
onChange={handlePlayerChange} onChange={handlePlayerChange}
required required
...@@ -126,7 +128,7 @@ export const MatchModal: React.FC = ({}) => { ...@@ -126,7 +128,7 @@ export const MatchModal: React.FC = ({}) => {
className={styles.input} className={styles.input}
type="text" type="text"
autoCorrect="off" autoCorrect="off"
placeholder="房间密码(可选)" placeholder={i18n("RoomPasswordOptional")}
value={passwd} value={passwd}
onChange={handlePasswdChange} onChange={handlePasswdChange}
/> />
......
...@@ -7,6 +7,7 @@ import { replayStore } from "@/stores"; ...@@ -7,6 +7,7 @@ import { replayStore } from "@/stores";
import { Uploader } from "../../Shared"; import { Uploader } from "../../Shared";
import { connectSrvpro } from "../util"; import { connectSrvpro } from "../util";
import { useTranslation } from "react-i18next";
const localStore = proxy({ const localStore = proxy({
open: false, open: false,
...@@ -17,6 +18,7 @@ export const ReplayModal: React.FC = () => { ...@@ -17,6 +18,7 @@ export const ReplayModal: React.FC = () => {
const { open, hasStart } = useSnapshot(localStore); const { open, hasStart } = useSnapshot(localStore);
const [replay, setReplay] = useState<null | ArrayBuffer>(null); const [replay, setReplay] = useState<null | ArrayBuffer>(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { t: i18n } = useTranslation("ReplayModal");
const uploadProps: UploadProps = { const uploadProps: UploadProps = {
name: "replay", name: "replay",
onChange(info) { onChange(info) {
...@@ -34,7 +36,7 @@ export const ReplayModal: React.FC = () => { ...@@ -34,7 +36,7 @@ export const ReplayModal: React.FC = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const onSubmit = async () => { const onSubmit = async () => {
if (replay === null) { if (replay === null) {
message.error("请先上传录像文件"); message.error(`${i18n("PleaseUploadReplayFile")}`);
} else { } else {
setLoading(true); setLoading(true);
...@@ -63,22 +65,22 @@ export const ReplayModal: React.FC = () => { ...@@ -63,22 +65,22 @@ export const ReplayModal: React.FC = () => {
return ( return (
<Modal <Modal
title="选择回放" title={i18n("SelectReplay")}
open={open} open={open}
maskClosable={false} maskClosable={false}
confirmLoading={loading} confirmLoading={loading}
centered centered
footer={ footer={
<Button onClick={onSubmit} loading={loading}> <Button onClick={onSubmit} loading={loading}>
开始回放 {i18n("StartReplay")}
</Button> </Button>
} }
onCancel={() => (localStore.open = false)} onCancel={() => (localStore.open = false)}
> >
<Uploader <Uploader
{...uploadProps} {...uploadProps}
text="单击或拖动文件到此区域进行上传" text={i18n("ClickOrDragFilesHereToUpload")}
hint="仅支持后缀名为yrp3d的录像文件。" hint={i18n("SupportsYrd3dExtension")}
/> />
</Modal> </Modal>
); );
......
...@@ -3,6 +3,7 @@ import { Button, Input } from "antd"; ...@@ -3,6 +3,7 @@ import { Button, Input } from "antd";
import { IconFont, ScrollableArea, useChat } from "@/ui/Shared"; import { IconFont, ScrollableArea, useChat } from "@/ui/Shared";
import styles from "./Chat.module.scss"; import styles from "./Chat.module.scss";
import { useTranslation } from "react-i18next";
interface ChatItem { interface ChatItem {
name: string; name: string;
...@@ -12,7 +13,7 @@ interface ChatItem { ...@@ -12,7 +13,7 @@ interface ChatItem {
export const Chat: React.FC = () => { export const Chat: React.FC = () => {
const { dialogs, input, setInput, ref, onSend } = useChat(); const { dialogs, input, setInput, ref, onSend } = useChat();
const { t: i18n } = useTranslation("Chat");
return ( return (
<div className={styles.chat}> <div className={styles.chat}>
<ScrollableArea className={styles.dialogs} ref={ref}> <ScrollableArea className={styles.dialogs} ref={ref}>
...@@ -26,7 +27,7 @@ export const Chat: React.FC = () => { ...@@ -26,7 +27,7 @@ export const Chat: React.FC = () => {
value={input} value={input}
onChange={(event) => setInput(event.target.value)} onChange={(event) => setInput(event.target.value)}
autoSize autoSize
placeholder="请输入聊天内容" placeholder={i18n("PleaseEnterChatContent")}
onPressEnter={(e) => { onPressEnter={(e) => {
e.preventDefault(); e.preventDefault();
onSend(); onSend();
......
...@@ -331,7 +331,7 @@ const SideButtons: React.FC<{ ...@@ -331,7 +331,7 @@ const SideButtons: React.FC<{
<span className={styles["btn-icon"]}> <span className={styles["btn-icon"]}>
<IconFont type="icon-side-bar-fill" size={16} /> <IconFont type="icon-side-bar-fill" size={16} />
<span className={styles["btn-text"]}> <span className={styles["btn-text"]}>
&nbsp;&nbsp;{collapsed ? i18n("Expand") : i18n("Collapse")}{/* {i18n("Sidebar")} */} &nbsp;&nbsp;{collapsed ? i18n("Expand") : i18n("Collapse")} {i18n("Sidebar")}
</span> </span>
</span> </span>
} }
......
  • @SKTT1Ryze Hello my friend! How are you doing? I would like a little help with Filters... How can we proceed with translating each filter (Attributes, Races, Types)? I saw that it comes from an artifact called wasm (I believe it is the one handling these values). Thank you for your time! Have a great week!!

    filters

    Edited by BBeretta
  • @BBeretta It depends on a Configuration, which the I18N is supported: [strings.conf]https://cdn02.moecube.com:444/ygopro-database/{zh-CN or en-US}/strings.conf. See strings.ts for more details.

    I'm at work and i would introduce some details for you later night, thank you!

  • @BBeretta The texts of filter(Attributes, Races, Types) are defined in strings.conf, whose url is https://cdn02.moecube.com:444/ygopro-database/{lang}/strings.conf. You can specify the lang of the url to get translations texts like zh-CN. It currently only supports en-US, es-ES, ja-JP, ko-KR, zh-CN. And it is in the strings.ts that fetches the translations and store them in the localStorage of the browser. So what we need to do is let strings.ts supports I18N.

    If you have any questions, feel free to create issues and tell me. Thanks for your efforts!

  • Hey @SKTT1Ryze Hey friend! Thank you very much for the information! I will take a look at that class and run some tests. Thanks!!

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment