diff --git a/src/components/base/base-empty.tsx b/src/components/base/base-empty.tsx
index c364a50a..665c12c5 100644
--- a/src/components/base/base-empty.tsx
+++ b/src/components/base/base-empty.tsx
@@ -1,5 +1,6 @@
import { alpha, Box, Typography } from "@mui/material";
import { InboxRounded } from "@mui/icons-material";
+import { useTranslation } from "react-i18next";
interface Props {
text?: React.ReactNode;
@@ -8,6 +9,7 @@ interface Props {
export const BaseEmpty = (props: Props) => {
const { text = "Empty", extra } = props;
+ const { t } = useTranslation();
return (
{
})}
>
- {text}
+ {t(`${text}`)}
{extra}
);
diff --git a/src/components/layout/layout-traffic.tsx b/src/components/layout/layout-traffic.tsx
index 747a0392..5f2d9b8a 100644
--- a/src/components/layout/layout-traffic.tsx
+++ b/src/components/layout/layout-traffic.tsx
@@ -13,6 +13,7 @@ import { useVisibility } from "@/hooks/use-visibility";
import parseTraffic from "@/utils/parse-traffic";
import useSWRSubscription from "swr/subscription";
import { createSockette } from "@/utils/websocket";
+import { useTranslation } from "react-i18next";
interface MemoryUsage {
inuse: number;
@@ -21,6 +22,7 @@ interface MemoryUsage {
// setup the traffic
export const LayoutTraffic = () => {
+ const { t } = useTranslation();
const { clashInfo } = useClashInfo();
const { verge } = useVerge();
@@ -115,7 +117,6 @@ export const LayoutTraffic = () => {
};
const valStyle: any = {
component: "span",
- // color: "primary",
textAlign: "center",
sx: { flex: "1 1 56px", userSelect: "none" },
};
@@ -128,15 +129,23 @@ export const LayoutTraffic = () => {
};
return (
-
+
{trafficGraph && pageVisible && (
-
+
)}
-
+
0 ? "secondary" : "disabled"}
@@ -147,7 +156,12 @@ export const LayoutTraffic = () => {
{upUnit}/s
-
+
0 ? "primary" : "disabled"}
@@ -163,7 +177,7 @@ export const LayoutTraffic = () => {
display="flex"
alignItems="center"
whiteSpace="nowrap"
- title="Memory Usage"
+ title={t("Memory Usage")}
>
{inuse}
diff --git a/src/components/profile/confirm-viewer.tsx b/src/components/profile/confirm-viewer.tsx
index 2ed293e6..382998b9 100644
--- a/src/components/profile/confirm-viewer.tsx
+++ b/src/components/profile/confirm-viewer.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from "react";
+import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import {
Button,
diff --git a/src/components/profile/editor-viewer.tsx b/src/components/profile/editor-viewer.tsx
index 1bfbb806..c64010f8 100644
--- a/src/components/profile/editor-viewer.tsx
+++ b/src/components/profile/editor-viewer.tsx
@@ -171,10 +171,10 @@ export const EditorViewer = (props: Props) => {
-
diff --git a/src/pages/rules.tsx b/src/pages/rules.tsx
index 662c626e..130901bc 100644
--- a/src/pages/rules.tsx
+++ b/src/pages/rules.tsx
@@ -62,7 +62,7 @@ const RulesPage = () => {
followOutput={"smooth"}
/>
) : (
-
+
)}