fix: update package dependencies and improve language handling in the header component

This commit is contained in:
晴猫
2026-03-15 10:06:44 +09:00
parent bf7e96c518
commit 9c577840cc
7 changed files with 18 additions and 20 deletions

View File

@@ -146,7 +146,7 @@
"react-day-picker": "^9.12.0",
"react-dom": "^19.2.1",
"react-i18next": "^16.5.4",
"react-joyride": "^2.9.3",
"react-joyride": "3.0.0-7",
"react-markdown": "^10.1.0",
"reactflow": "^11.11.4",
"recharts": "3.5.1",
@@ -155,7 +155,7 @@
"remark-math": "^6.0.0",
"smol-toml": "^1.5.2",
"tailwind-merge": "^3.4.0",
"@react-spring/web": "^9.7.5",
"@react-spring/web": "10.0.3",
"@use-gesture/react": "^10.3.1"
},
"devDependencies": {

View File

@@ -20,6 +20,7 @@ import { isElectron } from '@/lib/runtime'
import { cn } from '@/lib/utils'
const LANGUAGE_CODES = ['zh', 'en', 'ja', 'ko'] as const
const LANGUAGE_NAMES: Record<typeof LANGUAGE_CODES[number], string> = { "zh": "中文", "en": "English", "ja": "日本語", "ko": "한국어" }
interface HeaderProps {
sidebarOpen: boolean
@@ -138,12 +139,14 @@ export function Header({
<Button variant="ghost" size="sm" className="gap-2">
<Globe className="h-4 w-4" />
<span className="hidden sm:inline text-xs">
{t(`language.${currentLang.split('-')[0] as 'zh' | 'en' | 'ja' | 'ko'}`) ?? currentLang}
{LANGUAGE_NAMES[currentLang.split('-')[0] as 'zh' | 'en' | 'ja' | 'ko'] ?? currentLang}
</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
{LANGUAGE_CODES.map((code) => (
{
LANGUAGE_CODES.map((code) => (
<DropdownMenuItem
key={code}
onClick={() => i18nInstance.changeLanguage(code)}
@@ -155,7 +158,7 @@ export function Header({
{currentLang.split('-')[0] === code && (
<span className="mr-2"></span>
)}
{t(`language.${code}`)}
{LANGUAGE_NAMES[code]}
</DropdownMenuItem>
))}
</DropdownMenuContent>

View File

@@ -203,7 +203,6 @@ export function TourRenderer() {
zIndex: 99999,
},
},
disableAnimation: true,
}}
/>
)

View File

@@ -1,5 +1,4 @@
{
"language": { "zh": "中文", "en": "English", "ja": "日本語", "ko": "한국어" },
"header": {
"collapseSidebar": "Collapse sidebar",
"expandSidebar": "Expand sidebar",

View File

@@ -1,5 +1,4 @@
{
"language": { "zh": "中文", "en": "English", "ja": "日本語", "ko": "한국어" },
"header": {
"collapseSidebar": "サイドバーを折りたたむ",
"expandSidebar": "サイドバーを展開する",
@@ -89,7 +88,7 @@
"animationSpeed": "アニメーション速度",
"backgroundImage": "背景画像",
"backgroundBlur": "背景ぼかし",
"backgroundOpacity": "背景透明度",
"backgroundOpacity": "背景透明度",
"lightDesc": "常にライトテーマを使用",
"darkDesc": "常にダークテーマを使用",
"systemDesc": "システム設定に従って自動切り替え",
@@ -119,7 +118,7 @@
"fontFamilySerif": "セリフ (Serif)",
"fontFamilyMono": "等幅 (Monospace)",
"baseFontSize": "基準フォントサイズ (Base Size)",
"lineHeight": "行 (Line Height)",
"lineHeight": "行の高さ (Line Height)",
"lineHeightPlaceholder": "行高を選択",
"lineHeightCompact": "コンパクト (1.2)",
"lineHeightNormal": "標準 (1.5)",
@@ -186,7 +185,7 @@
"hide": "非表示",
"show": "表示",
"copyTip": "クリップボードにコピー",
"regenerateShort": "生成",
"regenerateShort": "生成する",
"confirmRegenerateFullDesc": "新しい 64 桁のセキュアトークンを生成し、現在の Token を即座に無効にします。新しい Token で再ログインが必要です。この操作は元に戻せません。続けますか?",
"confirmGenerate": "生成を確認",
"tokenStorePlaceholder": "Token はセキュアな Cookie に保存されています",
@@ -196,7 +195,7 @@
"tokenReqTitle": "Token セキュリティ要件:",
"tokenValid": "Token のフォーマットは正しく使用できます",
"updateBtn": "カスタム Token を更新",
"updating": "更新...",
"updating": "更新しています...",
"dialogTitle": "新しい Access Token",
"dialogDesc": "これが新しい Token です。すぐに保存してください。このウィンドウを閉じるとログインページにリダイレクトされます。",
"dialogTokenLabel": "新しい Token (64 桁セキュアトークン)",
@@ -247,10 +246,10 @@
"logCacheSizeDesc": "ログビューアがキャッシュする最大ログ数を制御します。大きい値はより多くのメモリを使用します。",
"logCacheSizeUnit": "件",
"dataSyncIntervalLabel": "ホームデータ更新間隔",
"dataSyncIntervalUnit": "秒",
"dataSyncIntervalUnit": "秒",
"dataSyncIntervalDesc": "ホーム画面の統計データの自動更新間隔を制御します",
"wsReconnectLabel": "WebSocket 再接続間隔",
"wsReconnectUnit": "秒",
"wsReconnectUnit": "秒",
"wsReconnectDesc": "ログ WebSocket 切断後の再接続基本間隔",
"wsMaxReconnectLabel": "WebSocket 最大再接続回数",
"wsMaxReconnectUnit": "回",
@@ -294,7 +293,7 @@
"openSource": "オープンソース",
"aboutApp": "MaiBot Dashboard について",
"version": "バージョン:",
"author": "者",
"author": "開発者",
"techStack": "技術スタック",
"frontendFramework": "フロントエンドフレームワーク",
"uiComponents": "UI コンポーネント",
@@ -384,7 +383,7 @@
"loading": "読み込み中...",
"error": "エラー",
"retry": "再試行",
"save": "保存",
"save": "保存する",
"cancel": "キャンセル",
"confirm": "確認",
"delete": "削除",
@@ -392,7 +391,7 @@
"close": "閉じる",
"search": "検索",
"noData": "データなし",
"success": "成功",
"success": "成功しました",
"failed": "失敗"
},
"restart": {
@@ -519,7 +518,7 @@
"noData": "データなし",
"replied": "返信 {{num}} 件",
"per100Messages": "100メッセージあたり",
"seconds": "秒",
"seconds": "秒",
"hours": "時間",
"days": "日"
},

View File

@@ -1,5 +1,4 @@
{
"language": { "zh": "中文", "en": "English", "ja": "日本語", "ko": "한국어" },
"header": {
"collapseSidebar": "사이드바 접기",
"expandSidebar": "사이드바 펼치기",

View File

@@ -1,5 +1,4 @@
{
"language": { "zh": "中文", "en": "English", "ja": "日本語", "ko": "한국어" },
"header": {
"collapseSidebar": "收起侧边栏",
"expandSidebar": "展开侧边栏",