Skip to content

Commit 7228744

Browse files
author
smallstone
committed
Update code comments and translations
1 parent bf0ba0a commit 7228744

6 files changed

Lines changed: 252 additions & 182 deletions

File tree

src/util/bridge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// 1. 打开设置
1414
// 2. 启动 ask code 安装
1515
// 3. 设置 access key
16-
- featureToggles ??
16+
- featureToggles // 判断有没有 ask code
1717
- isDevChatInstalled // 判断 ask code 是否安装
1818

1919
- historyMessages // 页面的历史消息

src/util/ideaBridge.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class IdeaBridge {
307307
this.resviesContext(res);
308308
break;
309309
case "getSetting/response":
310-
this.resviceSettings(res);
310+
// this.resviceSettings(res);
311311
break;
312312
case "listTopics/response":
313313
this.resviceTopicList(res);
@@ -377,7 +377,6 @@ class IdeaBridge {
377377
}
378378

379379
resviceSettings(res) {
380-
console.log("resviceSettings res: ", res);
381380
// 用户设置的回调
382381
const setting = res.payload.setting;
383382

src/views/components/InputMessage/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ 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-
import { useTranslation } from "react-i18next";
37+
import { Trans, useTranslation } from "react-i18next";
3838

3939
const useStyles = createStyles((theme) => ({
4040
actionIcon: {
@@ -312,7 +312,7 @@ const InputMessage = observer((props: any) => {
312312
color: theme.colors.gray[6],
313313
}}
314314
>
315-
{description}
315+
<Trans>{description}</Trans>
316316
</Text>
317317
</Stack>
318318
</Flex>

src/views/components/MessageBody/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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-
import { useTranslation } from "react-i18next";
6+
import { Trans, useTranslation } from "react-i18next";
77

88
interface IProps {
99
messageType: string;
@@ -23,13 +23,21 @@ const useStyles = createStyles((theme, options: any) => ({
2323
},
2424
}));
2525

26+
const trasnlateKey = (children: string) => {
27+
if (children && children.includes("You can configure DevChat from")) {
28+
return "devchat.help";
29+
}
30+
return "";
31+
};
32+
2633
const MessageBody = observer((props: IProps) => {
2734
const { children, messageType, temp = false, messageDone } = props;
2835
const { chat } = useMst();
2936
const { classes } = useStyles({
3037
chatPanelWidth: chat.chatPanelWidth,
3138
});
3239
const { t } = useTranslation();
40+
const transkey = trasnlateKey(children);
3341

3442
return messageType === "bot" ? (
3543
<MessageMarkdown

0 commit comments

Comments
 (0)