|
@@ -3,6 +3,7 @@ import { Popover, Typography } from "antd";
|
|
|
import { ProCard } from "@ant-design/pro-components";
|
|
import { ProCard } from "@ant-design/pro-components";
|
|
|
|
|
|
|
|
import { get } from "../../request";
|
|
import { get } from "../../request";
|
|
|
|
|
+import { get as getLang } from "../../locales";
|
|
|
import { IGuideResponse } from "../api/Guide";
|
|
import { IGuideResponse } from "../api/Guide";
|
|
|
import Marked from "../general/Marked";
|
|
import Marked from "../general/Marked";
|
|
|
|
|
|
|
@@ -33,7 +34,8 @@ const Widget = ({ text, gid }: IWidget) => {
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
function fetchData(key: string) {
|
|
function fetchData(key: string) {
|
|
|
- const url = `/v2/guide/zh-cn/${key}`;
|
|
|
|
|
|
|
+ const uiLang = getLang();
|
|
|
|
|
+ const url = `/v2/guide/${uiLang}/${key}`;
|
|
|
get<IGuideResponse>(url).then((json) => {
|
|
get<IGuideResponse>(url).then((json) => {
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
|
sessionStorage.setItem(grammarProfix + key, json.data);
|
|
sessionStorage.setItem(grammarProfix + key, json.data);
|