Skip to content

Commit c4a3f8e

Browse files
author
smallstone
committed
Update language translations and fix UI issues
1 parent 4a4c981 commit c4a3f8e

5 files changed

Lines changed: 42 additions & 2 deletions

File tree

src/util/ideaBridge.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ class IdeaBridge {
377377
}
378378

379379
resviceSettings(res) {
380+
console.log("resviceSettings res: ", res);
380381
// 用户设置的回调
381382
const setting = res.payload.setting;
382383

src/views/components/Header/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ export default function Head() {
8282
<IconSettings size="1.125rem" />
8383
</ActionIcon>
8484
</div>
85-
<div>
85+
{/* <div>
8686
<ActionIcon size="sm" onClick={switchLang}>
8787
<IconLanguage size="1.125rem" />
8888
</ActionIcon>
89-
</div>
89+
</div> */}
9090
</Flex>
9191
</Flex>
9292
</Header>

src/views/components/InputMessage/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ import Topic from "./Topic";
3434
import { observer } from "mobx-react-lite";
3535
import { useMst } from "@/views/stores/RootStore";
3636
import { ChatContext } from "@/views/stores/InputStore";
37+
<<<<<<< HEAD
3738
import { Trans, useTranslation } from "react-i18next";
39+
=======
40+
import { useTranslation } from "react-i18next";
41+
>>>>>>> 36a272b (Update language translations and fix UI issues)
3842

3943
const useStyles = createStyles((theme) => ({
4044
actionIcon: {

src/views/components/MessageBody/index.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ import React from "react";
33
import { observer } from "mobx-react-lite";
44
import MessageMarkdown from "@/views/components/MessageMarkdown";
55
import { useMst } from "@/views/stores/RootStore";
6+
<<<<<<< HEAD
67
import { Trans, useTranslation } from "react-i18next";
8+
=======
9+
import { useTranslation } from "react-i18next";
10+
>>>>>>> 36a272b (Update language translations and fix UI issues)
711

812
interface IProps {
913
messageType: string;
1014
children: string;
1115
messageDone?: boolean;
16+
<<<<<<< HEAD
1217
activeStep?: boolean;
18+
=======
19+
temp?: boolean;
20+
>>>>>>> 36a272b (Update language translations and fix UI issues)
1321
}
1422

1523
const useStyles = createStyles((theme, options: any) => ({
@@ -31,18 +39,29 @@ const trasnlateKey = (children: string) => {
3139
};
3240

3341
const MessageBody = observer((props: IProps) => {
42+
<<<<<<< HEAD
3443
const { children, messageType, activeStep = false, messageDone } = props;
44+
=======
45+
const { children, messageType, temp = false, messageDone } = props;
46+
>>>>>>> 36a272b (Update language translations and fix UI issues)
3547
const { chat } = useMst();
3648
const { classes } = useStyles({
3749
chatPanelWidth: chat.chatPanelWidth,
3850
});
3951
const { t } = useTranslation();
52+
<<<<<<< HEAD
4053
const transkey = trasnlateKey(children);
54+
=======
55+
>>>>>>> 36a272b (Update language translations and fix UI issues)
4156

4257
return messageType === "bot" ? (
4358
<MessageMarkdown
4459
className={classes.bodyWidth}
60+
<<<<<<< HEAD
4561
activeStep={activeStep}
62+
=======
63+
temp={temp}
64+
>>>>>>> 36a272b (Update language translations and fix UI issues)
4665
messageDone={messageDone}
4766
>
4867
{children}
@@ -55,7 +74,11 @@ const MessageBody = observer((props: IProps) => {
5574
width: chat.chatPanelWidth - 20,
5675
}}
5776
>
77+
<<<<<<< HEAD
5878
<pre className={classes.userContent}>{children}</pre>
79+
=======
80+
<pre className={classes.userContent}>{t(children)}</pre>
81+
>>>>>>> 36a272b (Update language translations and fix UI issues)
5982
</Container>
6083
);
6184
});

src/views/i18n/zh.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
<<<<<<< HEAD
23
"Delete message": "删除消息及回答",
34
"Copied": "已复制",
45
"Copy message": "复制回答",
@@ -17,4 +18,15 @@
1718
"commit changes with commit message in english.": "选择要提交的代码变更,总结英文提交消息,并提交到代码库。",
1819
"Generate a commit message for the given git diff.": "为给定的 git diff 生成提交消息。",
1920
"Generate a release note for the given commit log.": "为给定的提交日志生成发布说明。"
21+
=======
22+
"Delete message": "删除",
23+
"Copied": "已复制",
24+
"Copy message": "复制",
25+
"Refilled": "已发送",
26+
"Refill message": "再次发送",
27+
"User": "用户",
28+
"Ask DevChat a question or type ‘/’ for workflow": "向 DevChat 提问或输入 '/' 以查看工作流",
29+
"How do I use DevChat?": "如何使用 DevChat?",
30+
"balance": "您的余额为 {{formatedCurrency}},登录 <4>web.devchat.ai</4> 以获得更多 tokens"
31+
>>>>>>> 36a272b (Update language translations and fix UI issues)
2032
}

0 commit comments

Comments
 (0)