Skip to content

Commit 5f96804

Browse files
authored
Merge pull request #5920 from fishshi/i18n
Use i18n for DISCOVERY
2 parents 13430ea + 93c5320 commit 5f96804

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

app/components/sidebar.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
MIN_SIDEBAR_WIDTH,
2323
NARROW_SIDEBAR_WIDTH,
2424
Path,
25-
PLUGINS,
2625
REPO_URL,
2726
} from "../constant";
2827

@@ -32,6 +31,12 @@ import dynamic from "next/dynamic";
3231
import { showConfirm, Selector } from "./ui-lib";
3332
import clsx from "clsx";
3433

34+
const DISCOVERY = [
35+
{ name: Locale.Plugin.Name, path: Path.Plugins },
36+
{ name: "Stable Diffusion", path: Path.Sd },
37+
{ name: Locale.SearchChat.Page.Title, path: Path.SearchChat },
38+
];
39+
3540
const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, {
3641
loading: () => null,
3742
});
@@ -219,7 +224,7 @@ export function SideBarTail(props: {
219224
export function SideBar(props: { className?: string }) {
220225
useHotKey();
221226
const { onDragStart, shouldNarrow } = useDragSideBar();
222-
const [showPluginSelector, setShowPluginSelector] = useState(false);
227+
const [showDiscoverySelector, setshowDiscoverySelector] = useState(false);
223228
const navigate = useNavigate();
224229
const config = useAppConfig();
225230
const chatStore = useChatStore();
@@ -254,21 +259,21 @@ export function SideBar(props: { className?: string }) {
254259
icon={<DiscoveryIcon />}
255260
text={shouldNarrow ? undefined : Locale.Discovery.Name}
256261
className={styles["sidebar-bar-button"]}
257-
onClick={() => setShowPluginSelector(true)}
262+
onClick={() => setshowDiscoverySelector(true)}
258263
shadow
259264
/>
260265
</div>
261-
{showPluginSelector && (
266+
{showDiscoverySelector && (
262267
<Selector
263268
items={[
264-
...PLUGINS.map((item) => {
269+
...DISCOVERY.map((item) => {
265270
return {
266271
title: item.name,
267272
value: item.path,
268273
};
269274
}),
270275
]}
271-
onClose={() => setShowPluginSelector(false)}
276+
onClose={() => setshowDiscoverySelector(false)}
272277
onSelection={(s) => {
273278
navigate(s[0], { state: { fromHome: true } });
274279
}}

app/constant.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,11 +597,6 @@ export const internalAllowedWebDavEndpoints = [
597597
];
598598

599599
export const DEFAULT_GA_ID = "G-89WN60ZK2E";
600-
export const PLUGINS = [
601-
{ name: "Plugins", path: Path.Plugins },
602-
{ name: "Stable Diffusion", path: Path.Sd },
603-
{ name: "Search Chat", path: Path.SearchChat },
604-
];
605600

606601
export const SAAS_CHAT_URL = "https://nextchat.dev/chat";
607602
export const SAAS_CHAT_UTM_URL = "https://nextchat.dev/chat?utm=github";

app/locales/cn.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const cn = {
176176
},
177177
},
178178
Lang: {
179-
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
179+
Name: "Language", // 注意:如果要添加新的翻译,请不要翻译此值,将它保留为 `Language`
180180
All: "所有语言",
181181
},
182182
Avatar: "头像",
@@ -630,7 +630,7 @@ const cn = {
630630
Sysmessage: "你是一个助手",
631631
},
632632
SearchChat: {
633-
Name: "搜索",
633+
Name: "搜索聊天记录",
634634
Page: {
635635
Title: "搜索聊天记录",
636636
Search: "输入搜索关键词",

app/locales/tw.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ const tw = {
485485
},
486486
},
487487
SearchChat: {
488-
Name: "搜尋",
488+
Name: "搜尋聊天記錄",
489489
Page: {
490490
Title: "搜尋聊天記錄",
491491
Search: "輸入搜尋關鍵詞",

0 commit comments

Comments
 (0)