Skip to content

Commit c6e0b5a

Browse files
offiaccount welcome text (#4827)
* offiaccount welcome text * fix * Update Image.tsx --------- Co-authored-by: Archer <[email protected]>
1 parent 932aa28 commit c6e0b5a

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

packages/web/i18n/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@
923923
"not_open": "Not Open",
924924
"not_permission": "The current subscription package does not support team operation logs",
925925
"not_support": "Not Supported",
926+
"not_support_wechat_image": "WeChat image rendering is not supported",
926927
"not_yet_introduced": "No Introduction Yet",
927928
"open_folder": "Open Folder",
928929
"option": "Option",

packages/web/i18n/zh-CN/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@
922922
"not_open": "未开启",
923923
"not_permission": "当前订阅套餐不支持团队操作日志",
924924
"not_support": "不支持",
925+
"not_support_wechat_image": "暂时不支持微信图片渲染",
925926
"not_yet_introduced": "暂无介绍",
926927
"open_folder": "打开文件夹",
927928
"option": "选项",

packages/web/i18n/zh-Hant/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@
922922
"not_open": "未開啟",
923923
"not_permission": "當前訂閱套餐不支持團隊操作日誌",
924924
"not_support": "不支援",
925+
"not_support_wechat_image": "暫時不支持微信圖片渲染",
925926
"not_yet_introduced": "暫無介紹",
926927
"open_folder": "開啟資料夾",
927928
"option": "選項",

projects/app/src/components/Markdown/img/Image.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ import React, { useState } from 'react';
22
import { Box, type ImageProps, Skeleton } from '@chakra-ui/react';
33
import MyPhotoView from '@fastgpt/web/components/common/Image/PhotoView';
44
import { useBoolean } from 'ahooks';
5+
import { useTranslation } from 'next-i18next';
56

67
const MdImage = ({ src, ...props }: { src?: string } & ImageProps) => {
8+
const { t } = useTranslation();
79
const [isLoaded, { setTrue }] = useBoolean(false);
810

911
const [renderSrc, setRenderSrc] = useState(src);
1012

1113
if (src?.includes('base64') && !src.startsWith('data:image')) {
1214
return <Box>Invalid base64 image</Box>;
1315
}
16+
17+
if (props.alt?.startsWith('OFFIACCOUNT_MEDIA')) {
18+
return <Box>{t('common:not_support_wechat_image')}</Box>;
19+
}
20+
1421
return (
1522
<Skeleton isLoaded={isLoaded}>
1623
<MyPhotoView

0 commit comments

Comments
 (0)