支持folder主界面多语言

This commit is contained in:
xintaofei
2026-03-07 13:12:18 +08:00
parent 07963e9706
commit 3ddc8f165a
22 changed files with 902 additions and 167 deletions

View File

@@ -3,6 +3,7 @@
import { useCallback, useEffect, useRef, useState } from "react"
import { Reorder } from "motion/react"
import { FileText, GitCompare, X } from "lucide-react"
import { useTranslations } from "next-intl"
import { useWorkspaceContext } from "@/contexts/workspace-context"
import { useShortcutSettings } from "@/hooks/use-shortcut-settings"
import { matchShortcutEvent } from "@/lib/keyboard-shortcuts"
@@ -16,6 +17,7 @@ import {
} from "@/components/ui/context-menu"
export function FileWorkspaceTabBar() {
const t = useTranslations("Folder.fileWorkspace")
const {
mode,
activePane,
@@ -80,7 +82,7 @@ export function FileWorkspaceTabBar() {
if (fileTabs.length === 0) {
return (
<div className="h-10 px-3 flex items-center border-b border-border text-xs text-muted-foreground">
Files
{t("files")}
</div>
)
}
@@ -159,7 +161,7 @@ export function FileWorkspaceTabBar() {
event.stopPropagation()
closeFileTab(tab.id)
}}
aria-label="Close file tab"
aria-label={t("closeFileTab")}
>
<X className="h-3 w-3" />
</button>
@@ -167,14 +169,14 @@ export function FileWorkspaceTabBar() {
</ContextMenuTrigger>
<ContextMenuContent>
<ContextMenuItem onSelect={() => closeFileTab(tab.id)}>
{t("close")}
</ContextMenuItem>
<ContextMenuItem onSelect={() => closeOtherFileTabs(tab.id)}>
{t("closeOthers")}
</ContextMenuItem>
<ContextMenuSeparator />
<ContextMenuItem onSelect={closeAllFileTabs}>
{t("closeAll")}
</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>