Skip to content

"Vibe-Trading: Your Personal Trading Agent"

feat(i18n): expand reactive zh-CN localization

skloxo955a1d02d2a9
diff --git a/frontend/src/components/charts/CandlestickChart.tsx b/frontend/src/components/charts/CandlestickChart.tsx
index 2a67a58e0..ee1c43a57 100644
--- a/frontend/src/components/charts/CandlestickChart.tsx
+++ b/frontend/src/components/charts/CandlestickChart.tsx
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState, useMemo, useCallback } from "react";
+import i18n from "@/i18n";
import { cn } from "@/lib/utils";
import { ChevronDown } from "lucide-react";
import type { PriceBar, TradeMarker, IndicatorPoint } from "@/lib/api";
@@ -255,7 +256,7 @@ export function CandlestickChart({ data, markers, indicators, height = 500 }: Pr
}, [data, markers, baseData, indicatorCache, extraIndicators, sub, range, overlays, dark]);
if (data.length === 0) {
- return <div className="text-muted-foreground text-sm p-4">No price data</div>;
+ return <div className="text-muted-foreground text-sm p-4">{i18n.t("charts.noPriceData")}</div>;
}
return (
diff --git a/frontend/src/components/charts/CorrelationMatrix.tsx b/frontend/src/components/charts/CorrelationMatrix.tsx
index cdd0d9c38..6e77b54a3 100644
--- a/frontend/src/components/charts/CorrelationMatrix.tsx
+++ b/frontend/src/components/charts/CorrelationMatrix.tsx
@@ -1,4 +1,5 @@
import { useEffect, useRef } from "react";
+import i18n from "@/i18n";
import { echarts } from "@/lib/echarts";
import { getChartTheme } from "@/lib/chart-theme";
@@ -102,7 +103,7 @@ export function CorrelationMatrix({ labels, matrix, height = 500 }: Props) {
}, [labels, matrix]);
if (labels.length === 0) {
- return <div className="text-muted-foreground text-sm p-4">No correlation data</div>;
+ return <div className="text-muted-foreground text-sm p-4">{i18n.t("charts.noCorrelationData")}</div>;
}
return <div ref={ref} style={{ height }} />;
}
\ No newline at end of file
diff --git a/frontend/src/components/charts/EquityChart.tsx b/frontend/src/components/charts/EquityChart.tsx
index 6d05ae606..0bb5774c6 100644
--- a/frontend/src/components/charts/EquityChart.tsx
+++ b/frontend/src/components/charts/EquityChart.tsx
@@ -1,4 +1,5 @@
import { useEffect, useRef } from "react";
+import i18n from "@/i18n";
import type { EquityPoint } from "@/lib/api";
import { getChartTheme } from "@/lib/chart-theme";
import { abbreviateNum } from "@/lib/formatters";
@@ -106,7 +107,7 @@ export function EquityChart({ data, height = 300 }: Props) {
}, [data, dark]);
if (data.length === 0) {
- return <div className="text-muted-foreground text-sm p-4">No equity data</div>;
+ return <div className="text-muted-foreground text-sm p-4">{i18n.t("charts.noEquityData")}</div>;
}
return <div ref={ref} style={{ height }} />;
}
diff --git a/frontend/src/components/charts/ValidationPanel.tsx b/frontend/src/components/charts/ValidationPanel.tsx
index 3148c0c94..a36e6b01a 100644
--- a/frontend/src/components/charts/ValidationPanel.tsx
+++ b/frontend/src/components/charts/ValidationPanel.tsx
@@ -41,17 +41,17 @@ function MonteCarloSection({ mc }: { mc: NonNullable<ValidationData["monte_carlo
return (
<div className="space-y-3">
<div className="flex items-center gap-2">
- <h4 className="text-sm font-semibold">Monte Carlo Permutation Test</h4>
+ <h4 className="text-sm font-semibold">{i18n.t("validation.monteCarlo")}</h4>
<Badge value={sig ? i18n.t("validation.significant") : i18n.t("validation.notSignificant")} good={sig} />
</div>
<p className="text-xs text-muted-foreground">
- Shuffled trade order {mc.n_simulations.toLocaleString()} times to test if Sharpe is better than random.
+ {i18n.t("validation.monteCarloDesc", { n: mc.n_simulations.toLocaleString() })}
</p>
<div className="grid grid-cols-2 sm:grid-cols-4 gap-1 rounded-xl border border-border/60 bg-muted/20 p-3">
- <Stat label="Actual Sharpe" value={mc.actual_sharpe.toFixed(2)} />
- <Stat label="p-value (Sharpe)" value={mc.p_value_sharpe.toFixed(4)} sub={sig ? "< 0.05" : ">= 0.05"} />
- <Stat label="Simulated Mean" value={mc.simulated_sharpe_mean.toFixed(2)} sub={`std ${mc.simulated_sharpe_std.toFixed(2)}`} />
- <Stat label="Simulated 90% Range" value={`[${mc.simulated_sharpe_p5.toFixed(2)}, ${mc.simulated_sharpe_p95.toFixed(2)}]`} />
+ <Stat label={i18n.t("validation.actualSharpe")} value={mc.actual_sharpe.toFixed(2)} />
+ <Stat label={i18n.t("validation.pValueSharpe")} value={mc.p_value_sharpe.toFixed(4)} sub={sig ? "< 0.05" : ">= 0.05"} />
+ <Stat label={i18n.t("validation.simulatedMean")} value={mc.simulated_sharpe_mean.toFixed(2)} sub={`std ${mc.simulated_sharpe_std.toFixed(2)}`} />
+ <Stat label={i18n.t("validation.simulatedRange")} value={`[${mc.simulated_sharpe_p5.toFixed(2)}, ${mc.simulated_sharpe_p95.toFixed(2)}]`} />
</div>
{/* Visual: where actual falls in distribution */}
<div className="space-y-1">
@@ -75,17 +75,17 @@ function BootstrapSection({ bs }: { bs: NonNullable<ValidationData["bootstrap"]>
return (
<div className="space-y-3">
<div className="flex items-center gap-2">
- <h4 className="text-sm font-semibold">Bootstrap Sharpe CI</h4>
- <Badge value={reliable ? "CI > 0" : "CI includes 0"} good={reliable} />
+ <h4 className="text-sm font-semibold">{i18n.t("validation.bootstrap")}</h4>
+ <Badge value={reliable ? i18n.t("validation.ciAbove0") : i18n.t("validation.ciIncludes0")} good={reliable} />
</div>
<p className="text-xs text-muted-foreground">
- Resampled daily returns {bs.n_bootstrap.toLocaleString()} times to estimate {(bs.confidence * 100).toFixed(0)}% confidence interval.
+ {i18n.t("validation.bootstrapDesc", { n: bs.n_bootstrap.toLocaleString(), pct: (bs.confidence * 100).toFixed(0) + "%" })}
</p>
<div className="grid grid-cols-2 sm:grid-cols-4 gap-1 rounded-xl border border-border/60 bg-muted/20 p-3">
- <Stat label="Observed Sharpe" value={bs.observed_sharpe.toFixed(2)} />
- <Stat label={`${(bs.confidence * 100).toFixed(0)}% CI`} value={`[${bs.ci_lower.toFixed(2)}, ${bs.ci_upper.toFixed(2)}]`} />
- <Stat label="Median Sharpe" value={bs.median_sharpe.toFixed(2)} />
- <Stat label="P(Sharpe > 0)" value={pctFmt(bs.prob_positive)} />
+ <Stat label={i18n.t("validation.observedSharpe")} value={bs.observed_sharpe.toFixed(2)} />
+ <Stat label={i18n.t("validation.ci", { pct: (bs.confidence * 100).toFixed(0) + "%" })} value={`[${bs.ci_lower.toFixed(2)}, ${bs.ci_upper.toFixed(2)}]`} />
+ <Stat label={i18n.t("validation.medianSharpe")} value={bs.median_sharpe.toFixed(2)} />
+ <Stat label={i18n.t("validation.probSharpePositive")} value={pctFmt(bs.prob_positive)} />
</div>
{/* CI bar */}
<div className="space-y-1">
@@ -108,29 +108,29 @@ function WalkForwardSection({ wf }: { wf: NonNullable<ValidationData["walk_forwa
return (
<div className="space-y-3">
<div className="flex items-center gap-2">
- <h4 className="text-sm font-semibold">Walk-Forward Analysis</h4>
- <Badge value={`${wf.profitable_windows}/${wf.n_windows} profitable`} good={consistent ? true : wf.consistency_rate >= 0.5 ? null : false} />
+ <h4 className="text-sm font-semibold">{i18n.t("validation.walkForward")}</h4>
+ <Badge value={i18n.t("validation.profitable", { profitable: wf.profitable_windows, total: wf.n_windows })} good={consistent ? true : wf.consistency_rate >= 0.5 ? null : false} />
</div>
<p className="text-xs text-muted-foreground">
- Split into {wf.n_windows} sequential windows to check performance consistency.
+ {i18n.t("validation.walkForwardDesc", { n: wf.n_windows })}
</p>
<div className="grid grid-cols-2 sm:grid-cols-4 gap-1 rounded-xl border border-border/60 bg-muted/20 p-3">
- <Stat label="Consistency" value={pctFmt(wf.consistency_rate)} />
- <Stat label="Avg Return" value={pctFmt(wf.return_mean)} sub={`std ${pctFmt(wf.return_std)}`} />
- <Stat label="Avg Sharpe" value={wf.sharpe_mean.toFixed(2)} sub={`std ${wf.sharpe_std.toFixed(2)}`} />
- <Stat label="Windows" value={String(wf.n_windows)} />
+ <Stat label={i18n.t("validation.consistency")} value={pctFmt(wf.consistency_rate)} />
+ <Stat label={i18n.t("validation.avgReturn")} value={pctFmt(wf.return_mean)} sub={`std ${pctFmt(wf.return_std)}`} />
+ <Stat label={i18n.t("validation.avgSharpe")} value={wf.sharpe_mean.toFixed(2)} sub={`std ${wf.sharpe_std.toFixed(2)}`} />
+ <Stat label={i18n.t("validation.windows")} value={String(wf.n_windows)} />
</div>
{/* Per-window table */}
<table className="w-full text-xs">
<thead>
<tr className="border-b text-left text-muted-foreground">
<th className="py-1.5 pr-3">#</th>
- <th className="py-1.5 pr-3">Period</th>
- <th className="py-1.5 pr-3 text-right">Return</th>
- <th className="py-1.5 pr-3 text-right">Sharpe</th>
- <th className="py-1.5 pr-3 text-right">Max DD</th>
- <th className="py-1.5 pr-3 text-right">Trades</th>
- <th className="py-1.5 text-right">Win Rate</th>
+ <th className="py-1.5 pr-3">{i18n.t("validation.period2")}</th>
+ <th className="py-1.5 pr-3 text-right">{i18n.t("validation.return")}</th>
+ <th className="py-1.5 pr-3 text-right">{i18n.t("reports.sharpe")}</th>
+ <th className="py-1.5 pr-3 text-right">{i18n.t("validation.maxDd")}</th>
+ <th className="py-1.5 pr-3 text-right">{i18n.t("runDetail.trades")}</th>
+ <th className="py-1.5 text-right">{i18n.t("validation.winRate")}</th>
</tr>
</thead>
<tbody>
diff --git a/frontend/src/components/chat/MandateProposalCard.tsx b/frontend/src/components/chat/MandateProposalCard.tsx
index 3f17231ae..160fbdafc 100644
--- a/frontend/src/components/chat/MandateProposalCard.tsx
+++ b/frontend/src/components/chat/MandateProposalCard.tsx
@@ -90,10 +90,10 @@ function ProfileTile({
onClick={onAdjustToggle}
disabled={disabled}
className="inline-flex items-center gap-1 rounded-lg border px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40"
- title="Adjust this mandate"
+ title={i18n.t("mandate.adjustTitle")}
>
<SlidersHorizontal className="h-3 w-3" />
- Adjust
+ {i18n.t("mandate.adjust")}
</button>
</div>
@@ -139,7 +139,7 @@ function ProfileTile({
onAdjustCancel();
}
}}
- placeholder="e.g. keep this but raise the daily cap to 10"
+ placeholder={i18n.t("mandate.adjustPlaceholder")}
className="w-full rounded-lg border bg-background px-3 py-1.5 text-xs text-foreground outline-none focus:ring-2 focus:ring-primary/30"
/>
<div className="flex justify-end gap-2">
diff --git a/frontend/src/components/chat/PineScriptViewer.tsx b/frontend/src/components/chat/PineScriptViewer.tsx
index 4c977dffb..c5369fb22 100644
--- a/frontend/src/components/chat/PineScriptViewer.tsx
+++ b/frontend/src/components/chat/PineScriptViewer.tsx
@@ -56,7 +56,7 @@ export const PineScriptViewer = memo(function PineScriptViewer({ code, onClose }
className="inline-flex items-center gap-1 px-2 py-1.5 rounded-lg text-xs text-muted-foreground hover:text-foreground transition-colors"
>
<ExternalLink className="h-3 w-3" />
- Docs
+ {t("pineViewer.docs")}
</a>
<button
onClick={onClose}
diff --git a/frontend/src/components/chat/RunnerStatus.tsx b/frontend/src/components/chat/RunnerStatus.tsx
index 64fadc47a..14adbb64d 100644
--- a/frontend/src/components/chat/RunnerStatus.tsx
+++ b/frontend/src/components/chat/RunnerStatus.tsx
@@ -291,24 +291,24 @@ export const RunnerStatus = memo(function RunnerStatus({ status, unavailable, ha
type="button"
onClick={() => setOpen((v) => !v)}
className="inline-flex max-w-full items-center gap-1.5 justify-self-start rounded-lg bg-primary/10 px-2.5 py-1 text-left text-xs font-medium text-primary transition-colors hover:bg-primary/15"
- aria-label="Connector runtime status"
+ aria-label={i18n.t("runnerStatus.connectorRuntime")}
aria-expanded={open}
>
<Activity className="h-3 w-3 shrink-0" />
<span className="shrink-0">{i18n.t("runnerStatus.connectorRuntime")}</span>
<span className="truncate text-muted-foreground">
- {authorizedCount > 0 ? `${authorizedCount} connected` : "no connector connected"}
+ {authorizedCount > 0 ? i18n.t("runnerStatus.connected", { count: authorizedCount }) : i18n.t("runnerStatus.noConnector")}
</span>
{anyRunning && !isHalted && (
<span className="inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-600 dark:text-emerald-400">
<CircleDot className="h-2.5 w-2.5" />
- running
+ {i18n.t("runnerStatus.running")}
</span>
)}
{isHalted && (
<span className="inline-flex items-center gap-1 rounded-full bg-destructive/10 px-1.5 py-0.5 text-[10px] font-medium text-destructive">
<OctagonX className="h-2.5 w-2.5" />
- halted
+ {i18n.t("runnerStatus.halted")}
</span>
)}
<ChevronDown className={["h-3 w-3 shrink-0 transition-transform", open ? "rotate-180" : ""].join(" ")} aria-hidden="true" />
diff --git a/frontend/src/components/chat/WelcomeScreen.tsx b/frontend/src/components/chat/WelcomeScreen.tsx
index fc5807f72..caa601591 100644
--- a/frontend/src/components/chat/WelcomeScreen.tsx
+++ b/frontend/src/components/chat/WelcomeScreen.tsx
@@ -1,14 +1,14 @@
import { useTranslation } from "react-i18next";
-import { Bot, TrendingUp, Globe, Sparkles, Users, UserCircle2, NotebookPen, Landmark } from "lucide-react";
+import { Bot, TrendingUp, Globe, Sparkles, Users, UserCircle2, NotebookPen, Landmark } from "lucide-react";
interface Example {
- title: string;
- desc: string;
- prompt: string;
+ titleKey: string;
+ descKey: string;
+ promptKey: string;
}
interface Category {
- label: string;
+ labelKey: string;
icon: React.ReactNode;
color: string;
examples: Example[];
@@ -16,157 +16,157 @@ interface Category {
const CATEGORIES: Category[] = [
{
- label: "Multi-Market Backtest",
+ labelKey: "welcome.categories.multiMarketBacktest",
icon: <TrendingUp className="h-4 w-4" />,
color: "text-red-400 border-red-500/30 hover:border-red-500/60 hover:bg-red-500/5",
examples: [
{
- title: "Cross-Market Portfolio",
- desc: "A-shares + crypto + US equities with risk-parity optimizer",
- prompt: "Backtest a risk-parity portfolio of 000001.SZ, BTC-USDT, and AAPL for full-year 2024, compare against equal-weight baseline",
+ titleKey: "welcome.examples.crossMarketPortfolio",
+ descKey: "welcome.examples.crossMarketPortfolioDesc",
+ promptKey: "welcome.examples.crossMarketPortfolioPrompt",
},
{
- title: "BTC 5-Min MACD Strategy",
- desc: "Minute-level crypto backtest with real-time OKX data",
- prompt: "Backtest BTC-USDT 5-minute MACD strategy, fast=12 slow=26 signal=9, last 30 days",
+ titleKey: "welcome.examples.btcMacd",
+ descKey: "welcome.examples.btcMacdDesc",
+ promptKey: "welcome.examples.btcMacdPrompt",
},
{
- title: "US Tech Max Diversification",
- desc: "Portfolio optimizer across FAANG+ via yfinance",
- prompt: "Backtest AAPL, MSFT, GOOGL, AMZN, NVDA with max_diversification portfolio optimizer, full-year 2024",
+ titleKey: "welcome.examples.usTechMaxDiv",
+ descKey: "welcome.examples.usTechMaxDivDesc",
+ promptKey: "welcome.examples.usTechMaxDivPrompt",
},
],
},
{
- label: "Research & Analysis",
+ labelKey: "welcome.categories.researchAnalysis",
icon: <Sparkles className="h-4 w-4" />,
color: "text-amber-400 border-amber-500/30 hover:border-amber-500/60 hover:bg-amber-500/5",
examples: [
{
- title: "Multi-Factor Alpha Model",
- desc: "IC-weighted factor synthesis across 300 stocks",
- prompt: "Build a multi-factor alpha model using momentum, reversal, volatility, and turnover on CSI 300 constituents with IC-weighted factor synthesis, backtest 2023-2024",
+ titleKey: "welcome.examples.multiFactorAlpha",
+ descKey: "welcome.examples.multiFactorAlphaDesc",
+ promptKey: "welcome.examples.multiFactorAlphaPrompt",
},
{
- title: "Options Greeks Analysis",
- desc: "Black-Scholes pricing with Delta/Gamma/Theta/Vega",
- prompt: "Calculate option Greeks using Black-Scholes: spot=100, strike=105, risk-free rate=3%, vol=25%, expiry=90 days, analyze Delta/Gamma/Theta/Vega",
+ titleKey: "welcome.examples.optionsGreeks",
+ descKey: "welcome.examples.optionsGreeksDesc",
+ promptKey: "welcome.examples.optionsGreeksPrompt",
},
],
},
{
- label: "Swarm Teams",
+ labelKey: "welcome.categories.swarmTeams",
icon: <Users className="h-4 w-4" />,
color: "text-violet-400 border-violet-500/30 hover:border-violet-500/60 hover:bg-violet-500/5",
examples: [
{
- title: "Investment Committee Review",
- desc: "Multi-agent debate: long vs short, risk review, PM decision",
- prompt: "[Swarm Team Mode] Use the investment_committee preset to evaluate whether to go long or short on NVDA given current market conditions",
+ titleKey: "welcome.examples.investmentCommittee",
+ descKey: "welcome.examples.investmentCommitteeDesc",
+ promptKey: "welcome.examples.investmentCommitteePrompt",
},
{
- title: "Quant Strategy Desk",
- desc: "Screening → factor research → backtest → risk audit pipeline",
- prompt: "[Swarm Team Mode] Use the quant_strategy_desk preset to find and backtest the best momentum strategy on CSI 300 constituents",
+ titleKey: "welcome.examples.quantStrategyDesk",
+ descKey: "welcome.examples.quantStrategyDeskDesc",
+ promptKey: "welcome.examples.quantStrategyDeskPrompt",
},
],
},
{
- label: "Document & Web Research",
+ labelKey: "welcome.categories.docWebResearch",
icon: <Globe className="h-4 w-4" />,
color: "text-blue-400 border-blue-500/30 hover:border-blue-500/60 hover:bg-blue-500/5",
examples: [
{
- title: "Analyze an Earnings Report PDF",
- desc: "Upload a PDF and ask questions about the financials",
- prompt: "Summarize the key financial metrics, risks, and outlook from the uploaded earnings report",
+ titleKey: "welcome.examples.earningsReport",
+ descKey: "welcome.examples.earningsReportDesc",
+ promptKey: "welcome.examples.earningsReportPrompt",
},
{
- title: "Web Research: Macro Outlook",
- desc: "Read live web sources for macro analysis",
- prompt: "Read the latest Fed meeting minutes and summarize the key takeaways for equity and crypto markets",
+ titleKey: "welcome.examples.macroResearch",
+ descKey: "welcome.examples.macroResearchDesc",
+ promptKey: "welcome.examples.macroResearchPrompt",
},
],
},
{
- label: "Trade Journal",
+ labelKey: "welcome.categories.tradeJournal",
icon: <NotebookPen className="h-4 w-4" />,
color: "text-orange-400 border-orange-500/30 hover:border-orange-500/60 hover:bg-orange-500/5",
examples: [
{
- title: "Analyze My Broker Export",
- desc: "Parse 同花顺/东财/富途/generic CSV — holding days, win rate, PnL ratio, hourly distribution",
- prompt: "Analyze the trade journal I just uploaded — full profile with holding stats, win rate, top symbols, and hourly distribution",
+ titleKey: "welcome.examples.analyzeBrokerExport",
+ descKey: "welcome.examples.analyzeBrokerExportDesc",
+ promptKey: "welcome.examples.analyzeBrokerExportPrompt",
},
{
- title: "Diagnose My Behavior Biases",
- desc: "Disposition effect, overtrading, chasing momentum, anchoring — severity + numeric evidence",
- prompt: "Run the 4 behavior diagnostics on my trade journal (disposition, overtrading, chasing, anchoring) and tell me which bias hurts my PnL most",
+ titleKey: "welcome.examples.diagnoseBehavior",
+ descKey: "welcome.examples.diagnoseBehaviorDesc",
+ promptKey: "welcome.examples.diagnoseBehaviorPrompt",
},
],
},
{
- label: "Trading Connectors",
+ labelKey: "welcome.categories.tradingConnectors",
icon: <Landmark className="h-4 w-4" />,
color: "text-cyan-400 border-cyan-500/30 hover:border-cyan-500/60 hover:bg-cyan-500/5",
examples: [
{
- title: "Check Selected Connector",
- desc: "List connector profiles and verify the selected one",
- prompt: "List my trading connector profiles, show which one is selected, then check that selected connector. If it is not ready, tell me exactly what setup step is missing. Do not place or modify orders.",
+ titleKey: "welcome.examples.checkConnector",
+ descKey: "welcome.examples.checkConnectorDesc",
+ promptKey: "welcome.examples.checkConnectorPrompt",
},
{
- title: "Analyze Connector Portfolio",
- desc: "Read account summary and positions from the selected connector",
- prompt: "Use the selected trading connector profile to summarize my account, positions, concentration, cash, and portfolio risk. Do not place or modify orders.",
+ titleKey: "welcome.examples.analyzePortfolio",
+ descKey: "welcome.examples.analyzePortfolioDesc",
+ promptKey: "welcome.examples.analyzePortfolioPrompt",
},
{
- title: "Quote & Trend",
- desc: "Fetch a quote plus recent daily bars through the selected connector",
- prompt: "Use the selected trading connector to fetch an AAPL quote and 30 daily bars, then summarize the current quote versus the recent trend. Keep it read-only.",
+ titleKey: "welcome.examples.quoteTrend",
+ descKey: "welcome.examples.quoteTrendDesc",
+ promptKey: "welcome.examples.quoteTrendPrompt",
},
],
},
{
- label: "Shadow Account",
+ labelKey: "welcome.categories.shadowAccount",
icon: <UserCircle2 className="h-4 w-4" />,
color: "text-emerald-400 border-emerald-500/30 hover:border-emerald-500/60 hover:bg-emerald-500/5",
examples: [
{
- title: "Train My Shadow from Journal",
- desc: "Extract your strategy rules from a broker CSV and persist a Shadow profile",
- prompt: "Train my shadow account from the trading journal I just uploaded — show the extracted rules and confirm they look like my behavior",
+ titleKey: "welcome.examples.trainShadow",
+ descKey: "welcome.examples.trainShadowDesc",
+ promptKey: "welcome.examples.trainShadowPrompt",
},
{
- title: "How Much Am I Leaving on the Table?",
- desc: "Backtest your shadow strategy and attribute delta vs. your actual PnL",
- prompt: "Run a shadow backtest for the last 90 days on the US market and break down where my PnL diverged from the shadow (rule violations, early exits, missed signals)",
+ titleKey: "welcome.examples.shadowDelta",
+ descKey: "welcome.examples.shadowDeltaDesc",
+ promptKey: "welcome.examples.shadowDeltaPrompt",
},
{
- title: "Generate Shadow Report",
- desc: "8-section HTML/PDF — equity curve, per-market Sharpe, attribution waterfall",
- prompt: "Render the shadow report and give me the URL — lead with the you-vs-shadow delta",
+ titleKey: "welcome.examples.shadowReport",
+ descKey: "welcome.examples.shadowReportDesc",
+ promptKey: "welcome.examples.shadowReportPrompt",
},
],
},
];
-const CAPABILITY_CHIPS = [
- "Finance Skills Library",
- "Swarm Agent Teams",
- "Auto-Discovered Tools",
- "3 Markets: A-Share · Crypto · HK/US",
- "Trading Connector Profiles",
- "Minute to Daily Timeframes",
- "4 Portfolio Optimizers",
- "15+ Risk Metrics",
- "Options & Derivatives",
- "PDF & Web Research",
- "Factor Analysis & ML",
- "Trade Journal Analyzer",
- "Shadow Account Backtest",
- "Persistent Memory",
- "Session Search",
+const CAPABILITY_CHIP_KEYS = [
+ "financeSkills",
+ "swarmTeams",
+ "autoTools",
+ "markets",
+ "connectors",
+ "timeframes",
+ "optimizers",
+ "riskMetrics",
+ "options",
+ "pdfWeb",
+ "factorML",
+ "journalAnalyzer",
+ "shadowBacktest",
+ "memory",
+ "sessionSearch",
];
interface Props {
@@ -185,22 +185,22 @@ export function WelcomeScreen({ onExample }: Props) {
<div>
<h2 className="text-2xl font-bold tracking-tight">{t('welcome.title')}</h2>
<p className="text-xs text-muted-foreground mt-1 max-w-sm mx-auto leading-relaxed">
- vibe trading with your professional financial agent team
+ {t('welcome.subtitle')}
</p>
<p className="text-sm text-muted-foreground mt-2 max-w-md leading-relaxed mx-auto">
- Describe a trading strategy to get started.
+ {t('welcome.describePrompt')}
</p>
</div>
</div>
{/* Capability chips */}
<div className="flex flex-wrap justify-center gap-2 max-w-lg">
- {CAPABILITY_CHIPS.map((chip) => (
+ {CAPABILITY_CHIP_KEYS.map((key) => (
<span
- key={chip}
+ key={key}
className="px-2.5 py-1 text-xs rounded-full border border-border/60 text-muted-foreground bg-muted/30"
>
- {chip}
+ {t(`welcome.capabilities.${key}`)}
</span>
))}
</div>
@@ -210,23 +210,23 @@ export function WelcomeScreen({ onExample }: Props) {
<p className="text-xs text-muted-foreground px-1">{t('welcome.tryExample')}</p>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
{CATEGORIES.map((cat) => (
- <div key={cat.label} className="space-y-2">
+ <div key={cat.labelKey} className="space-y-2">
<div className={`flex items-center gap-1.5 text-xs font-medium px-1 ${cat.color.split(" ").filter(c => c.startsWith("text-")).join(" ")}`}>
{cat.icon}
- <span>{cat.label}</span>
+ <span>{t(cat.labelKey)}</span>
</div>
<div className="space-y-1.5">
{cat.examples.map((ex) => (
<button
- key={ex.title}
- onClick={() => onExample(ex.prompt)}
+ key={ex.titleKey}
+ onClick={() => onExample(t(ex.promptKey))}
className={`block w-full text-left px-3 py-2.5 rounded-xl border transition-colors ${cat.color}`}
>
<span className="text-sm font-medium text-foreground leading-snug">
- {ex.title}
+ {t(ex.titleKey)}
</span>
<span className="block text-xs text-muted-foreground mt-0.5 leading-snug">
- {ex.desc}
+ {t(ex.descKey)}
</span>
</button>
))}
diff --git a/frontend/src/components/chat/__tests__/WelcomeScreen.test.tsx b/frontend/src/components/chat/__tests__/WelcomeScreen.test.tsx
index 42dffb7da..759aab514 100644
--- a/frontend/src/components/chat/__tests__/WelcomeScreen.test.tsx
+++ b/frontend/src/components/chat/__tests__/WelcomeScreen.test.tsx
@@ -21,7 +21,7 @@ describe("WelcomeScreen", () => {
it("renders example categories", () => {
render(<WelcomeScreen onExample={onExample} />);
- expect(screen.getByText("Multi-Market Backtest")).toBeInTheDocument();
+ expect(screen.getByText("A-Share Backtest")).toBeInTheDocument();
expect(screen.getByText("Research & Analysis")).toBeInTheDocument();
expect(screen.getByText("Swarm Teams")).toBeInTheDocument();
});
@@ -29,7 +29,7 @@ describe("WelcomeScreen", () => {
it("calls onExample with prompt when an example button is clicked", async () => {
render(<WelcomeScreen onExample={onExample} />);
const user = userEvent.setup();
- await user.click(screen.getByText("Cross-Market Portfolio"));
+ await user.click(screen.getByText("A-Share Portfolio Optimization"));
expect(onExample).toHaveBeenCalledTimes(1);
expect(onExample).toHaveBeenCalledWith(
expect.stringContaining("risk-parity portfolio"),
diff --git a/frontend/src/components/layout/Layout.tsx b/frontend/src/components/layout/Layout.tsx
index ef16d7232..3368a5564 100644
--- a/frontend/src/components/layout/Layout.tsx
+++ b/frontend/src/components/layout/Layout.tsx
@@ -9,7 +9,7 @@ import { useAgentStore } from "@/stores/agent";
import { ConnectionBanner } from "@/components/layout/ConnectionBanner";
// Bump on each release; one place keeps the footer in sync with package.json.
-const APP_VERSION = "v0.1.10";
+const APP_VERSION = "v0.1.10-s1";
export function Layout() {
const { t, i18n: i18nHook } = useTranslation();
@@ -117,7 +117,7 @@ export function Layout() {
<div className="flex items-center justify-between px-4 py-2">
<span className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
<MessageSquare className="h-3.5 w-3.5" />
- Sessions
+ {t('layout.sessions')}
</span>
<Link
to="/agent"
@@ -229,7 +229,7 @@ export function Layout() {
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
>
{dark ? <Sun className="h-3.5 w-3.5" /> : <Moon className="h-3.5 w-3.5" />}
- {dark ? "Light" : "Dark"}
+ {dark ? t('layout.light') : t('layout.dark')}
</button>
<div className="flex items-center gap-1">
<button
diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json
index c0a147219..3ceca0194 100644
--- a/frontend/src/i18n/locales/en.json
+++ b/frontend/src/i18n/locales/en.json
@@ -2,6 +2,11 @@
"app": {
"version": "v0.1.10"
},
+ "charts": {
+ "noPriceData": "No price data",
+ "noCorrelationData": "No correlation data",
+ "noEquityData": "No equity data"
+ },
"layout": {
"home": "Home",
"agent": "Agent",
@@ -117,7 +122,7 @@
"describePrompt": "Describe a trading strategy to get started.",
"tryExample": "Try an example:",
"categories": {
- "multiMarketBacktest": "Multi-Market Backtest",
+ "multiMarketBacktest": "A-Share Backtest",
"researchAnalysis": "Research & Analysis",
"swarmTeams": "Swarm Teams",
"docWebResearch": "Document & Web Research",
@@ -126,46 +131,63 @@
"shadowAccount": "Shadow Account"
},
"examples": {
- "crossMarketPortfolio": "Cross-Market Portfolio",
- "crossMarketPortfolioDesc": "A-shares + crypto + US equities with risk-parity optimizer",
- "btcMacd": "BTC 5-Min MACD Strategy",
- "btcMacdDesc": "Minute-level crypto backtest with real-time OKX data",
- "usTechMaxDiv": "US Tech Max Diversification",
- "usTechMaxDivDesc": "Portfolio optimizer across FAANG+ via yfinance",
+ "crossMarketPortfolio": "A-Share Portfolio Optimization",
+ "crossMarketPortfolioDesc": "A-shares portfolio optimization with risk-parity optimizer",
+ "crossMarketPortfolioPrompt": "Build a risk-parity portfolio with 000001.SZ, 600519.SH, 000858.SZ, backtest for the full year of 2024, and compare with equal-weighted benchmark",
+ "btcMacd": "A-Share MACD Strategy",
+ "btcMacdDesc": "Minute-level A-share MACD strategy backtest",
+ "btcMacdPrompt": "Backtest MACD strategy on 000001.SZ 5-minute bars: fast=12, slow=26, signal=9, last 30 days",
+ "usTechMaxDiv": "Blue-Chip Max Diversification",
+ "usTechMaxDivDesc": "Blue-chip max diversification portfolio",
+ "usTechMaxDivPrompt": "Backtest the maximum diversification portfolio for 600519.SH, 000858.SZ, 601318.SH, 000001.SZ, 600036.SH for the full year of 2024",
"multiFactorAlpha": "Multi-Factor Alpha Model",
"multiFactorAlphaDesc": "IC-weighted factor synthesis across 300 stocks",
+ "multiFactorAlphaPrompt": "Build a multi-factor alpha model using momentum, reversal, volatility, and turnover on CSI 300 constituents with IC-weighted factor synthesis, backtest 2023-2024",
"optionsGreeks": "Options Greeks Analysis",
"optionsGreeksDesc": "Black-Scholes pricing with Delta/Gamma/Theta/Vega",
+ "optionsGreeksPrompt": "Calculate option Greeks using Black-Scholes: spot=100, strike=105, risk-free rate=3%, vol=25%, expiry=90 days, analyze Delta/Gamma/Theta/Vega",
"investmentCommittee": "Investment Committee Review",
"investmentCommitteeDesc": "Multi-agent debate: long vs short, risk review, PM decision",
+ "investmentCommitteePrompt": "[Swarm Team Mode] Use the investment_committee preset to evaluate whether to go long or short on 600519.SH given current market conditions",
"quantStrategyDesk": "Quant Strategy Desk",
"quantStrategyDeskDesc": "Screening → factor research → backtest → risk audit pipeline",
+ "quantStrategyDeskPrompt": "[Swarm Team Mode] Use the quant_strategy_desk preset to find and backtest the best momentum strategy on CSI 300 constituents",
"earningsReport": "Analyze an Earnings Report PDF",
"earningsReportDesc": "Upload a PDF and ask questions about the financials",
+ "earningsReportPrompt": "Summarize the key financial metrics, risks, and outlook from the uploaded earnings report",
"macroResearch": "Web Research: Macro Outlook",
- "macroResearchDesc": "Read live web sources for macro analysis",
+ "macroResearchDesc": "Macro analysis and A-share market outlook",
+ "macroResearchPrompt": "Read the latest central bank monetary policy report and summarize its impact on the A-share market",
"analyzeBrokerExport": "Analyze My Broker Export",
"analyzeBrokerExportDesc": "Parse 同花顺/东财/富途/generic CSV — holding days, win rate, PnL ratio, hourly distribution",
+ "analyzeBrokerExportPrompt": "Analyze the trade journal I just uploaded — full profile with holding stats, win rate, top symbols, and hourly distribution",
"diagnoseBehavior": "Diagnose My Behavior Biases",
"diagnoseBehaviorDesc": "Disposition effect, overtrading, chasing momentum, anchoring — severity + numeric evidence",
+ "diagnoseBehaviorPrompt": "Run the 4 behavior diagnostics on my trade journal (disposition, overtrading, chasing, anchoring) and tell me which bias hurts my PnL most",
"checkConnector": "Check Selected Connector",
"checkConnectorDesc": "List connector profiles and verify the selected one",
+ "checkConnectorPrompt": "List my trading connector profiles, show which one is selected, then check that selected connector. If it is not ready, tell me exactly what setup step is missing. Do not place or modify orders.",
"analyzePortfolio": "Analyze Connector Portfolio",
"analyzePortfolioDesc": "Read account summary and positions from the selected connector",
+ "analyzePortfolioPrompt": "Use the selected trading connector profile to summarize my account, positions, concentration, cash, and portfolio risk. Do not place or modify orders.",
"quoteTrend": "Quote & Trend",
"quoteTrendDesc": "Fetch a quote plus recent daily bars through the selected connector",
+ "quoteTrendPrompt": "Use the selected trading connector to fetch a 600519.SH quote and 30 daily bars, then summarize the current quote versus the recent trend. Keep it read-only.",
"trainShadow": "Train My Shadow from Journal",
"trainShadowDesc": "Extract your strategy rules from a broker CSV and persist a Shadow profile",
+ "trainShadowPrompt": "Train my shadow account from the trading journal I just uploaded — show the extracted rules and confirm they look like my behavior",
"shadowDelta": "How Much Am I Leaving on the Table?",
"shadowDeltaDesc": "Backtest your shadow strategy and attribute delta vs. your actual PnL",
+ "shadowDeltaPrompt": "Run a shadow backtest for the last 90 days and break down where my PnL diverged from the shadow (rule violations, early exits, missed signals)",
"shadowReport": "Generate Shadow Report",
- "shadowReportDesc": "8-section HTML/PDF — equity curve, per-market Sharpe, attribution waterfall"
+ "shadowReportDesc": "8-section HTML/PDF — equity curve, per-market Sharpe, attribution waterfall",
+ "shadowReportPrompt": "Render the shadow report and give me the URL — lead with the you-vs-shadow delta"
},
"capabilities": {
"financeSkills": "Finance Skills Library",
"swarmTeams": "Swarm Agent Teams",
"autoTools": "Auto-Discovered Tools",
- "markets": "3 Markets: A-Share · Crypto · HK/US",
+ "markets": "A-Share · Multi-Factor · Quantitative",
"connectors": "Trading Connector Profiles",
"timeframes": "Minute to Daily Timeframes",
"optimizers": "4 Portfolio Optimizers",
@@ -199,6 +221,12 @@
"timeoutSeconds": "Timeout (seconds)",
"maxRetries": "Max Retries",
"reasoningEffort": "Reasoning Effort",
+ "off": "Off",
+ "reasoningEffortLow": "Low",
+ "reasoningEffortMedium": "Medium",
+ "reasoningEffortHigh": "High",
+ "reasoningEffortMax": "Max",
+ "reasoningEffortDesc": "How hard the model thinks before answering. Higher is more thorough but slower; leave Off for fastest replies.",
"useDefaultModel": "Use default model",
"useDefaultUrl": "Use default URL",
"dataSourcesDesc": "Configure external data sources for the backtesting engine.",
@@ -214,7 +242,50 @@
"loaderAvailable": "Loader available",
"noProjectLoader": "No project loader",
"pythonPackageInstalled": "Python package installed",
- "pythonPackageNotInstalled": "Python package not installed"
+ "pythonPackageNotInstalled": "Python package not installed",
+ "localApiAccess": "Local API access",
+ "localApiAccessDesc": "For remote or private Web UI deployments, enter the server API key once in this browser. Localhost use can stay blank.",
+ "serverApiKey": "Server API key",
+ "storedInBrowser": "Stored only in this browser. Leave blank to clear it.",
+ "localApiKeySaved": "Local API key saved",
+ "subtitle": "Configure model credentials and market data source tokens for this local project.",
+ "unavailable": "Settings are unavailable",
+ "llmSettings": "LLM Settings",
+ "llmSettingsDesc": "Choose the model used by the agent and save it to the project-local agent/.env file.",
+ "connection": "Connection",
+ "model": "Model",
+ "useProviderDefaults": "Use provider defaults",
+ "modelIdHint": "Use the exact model id required by your provider.",
+ "clearApiKey": "Clear saved API key",
+ "generation": "Generation",
+ "dataSourceSettings": "Data Source Settings",
+ "dataSourceSettingsDesc": "Configure optional market data credentials used by backtests and research agents.",
+ "tushareToken": "Tushare token",
+ "clearTushareToken": "Clear saved Tushare token",
+ "saveDataSourceSettings": "Save data source settings",
+ "baostock": "BaoStock",
+ "loadLlmSettingsFailed": "Failed to load LLM settings: {{message}}",
+ "loadDataSourceSettingsFailed": "Failed to load data source settings: {{message}}",
+ "llmSettingsSaved": "LLM settings saved",
+ "saveLlmSettingsFailed": "Failed to save LLM settings: {{message}}",
+ "dataSourceSettingsSaved": "Data source settings saved",
+ "saveDataSourceSettingsFailed": "Failed to save data source settings: {{message}}",
+ "configured": "Configured",
+ "keepCurrentKey": "Leave blank to keep the current key",
+ "providerUsesOauth": "This provider uses OAuth. Run: {{command}}",
+ "noApiKeyRequired": "This provider does not require an API key.",
+ "keepCurrentToken": "Leave blank to keep the current token",
+ "iwencaiApiKey": "iWenCai API Key",
+ "fredApiKey": "FRED API Key",
+ "iwencaiDesc": "Used for semantic stock screening via iWenCai (问财). Free access key required.",
+ "clearSavedKey": "Clear saved key",
+ "fredDesc": "Used for FRED macroeconomic data (CPI, GDP, unemployment, etc.). Free key from fred.stlouisfed.org.",
+ "featureFlags": "Feature Flags",
+ "featureFlagsDesc": "Runtime feature flags detected from environment variables.",
+ "shellTools": "Shell Tools",
+ "scheduler": "Scheduler",
+ "sessionRuntime": "Session Runtime",
+ "flagsReadFrom": "Flags are read from {{env1}}, {{env2}}, and {{env3}} in {{env_path}}."
},
"agent": {
"connectionLostReconnect": "Connection lost, reconnecting…",
@@ -259,7 +330,18 @@
"uploaded": "Uploaded: {{filename}}",
"uploadFailed": "Upload failed: {{error}}",
"failedToSend": "Failed to send message, please retry.",
- "failedToContinue": "Failed to continue goal, please retry."
+ "failedToContinue": "Failed to continue goal, please retry.",
+ "runtimeBadge": "RUNTIME",
+ "activeResearchGoal": "Active research goal",
+ "evidenceCollectedTitle": "Evidence collected toward this research goal",
+ "evidenceCount": "{{count}} evidence",
+ "uploading": "Uploading...",
+ "haltConnectorTitle": "Instantly halt connector runtime activity",
+ "haltConnector": "Halt connector runtime",
+ "moreOptions": "More options",
+ "uploadPdf": "Upload PDF document",
+ "researchGoal": "Research Goal",
+ "agentSwarm": "Agent Swarm"
},
"runDetail": {
"title": "Run Detail",
@@ -341,11 +423,14 @@
"correlation": {
"title": "Correlation Matrix",
"assetCodes": "Asset codes",
- "assetCodesHint": "Comma-separated ticker symbols, e.g. BTC-USDT,ETH-USDT,AAPL,SPY",
+ "assetCodesHint": "Comma-separated ticker symbols, e.g. 000001.SZ,600519.SH,000858.SZ",
"windowDays": "Window (days)",
"method": "Method",
+ "method_pearson": "Pearson",
+ "method_spearman": "Spearman",
"compute": "Compute",
- "loading": "Loading..."
+ "loading": "Computing...",
+ "failedToCompute": "Failed to compute correlation"
},
"alphaZoo": {
"title": "Alpha Zoo",
@@ -421,7 +506,60 @@
"icPositiveTitle": "Share of periods with positive IC",
"sampleCount": "n",
"sampleCountTitle": "IC sample count",
- "noBenchmarkMatch": "No benchmark match"
+ "noBenchmarkMatch": "No benchmark match",
+ "alphaCatalogue": "Alpha catalogue",
+ "predictiveHalfLifeTitle": "Predictive half-life: trading days before the signal's edge decays",
+ "id": "ID",
+ "icSampleCount": "IC sample count",
+ "alpha": "Alpha",
+ "alphaComparisonRanking": "Alpha comparison ranking",
+ "skippedPre": "Skipped:",
+ "zooCardTitle": {
+ "qlib158": "Qlib 158",
+ "alpha101": "Kakushadze 101 Formulaic Alphas",
+ "gtja191": "GTJA 191",
+ "academic": "Academic Anomalies"
+ },
+ "zooCardDesc": {
+ "qlib158": "Microsoft Qlib's full 158-feature library covering momentum, volatility, volume and rolling statistical signals.",
+ "alpha101": "The 101 formulaic alphas from Kakushadze (2015); short-horizon cross-sectional signals.",
+ "gtja191": "Guotai Junan Securities' 191 alphas; technical and microstructure signals tuned to China A-share markets.",
+ "academic": "Curated long-horizon anomalies from the academic literature (value, momentum, quality, low-vol, etc.)."
+ },
+ "universeOption": {
+ "csi300": "CSI 300 (China A)",
+ "sp500": "S&P 500 (US)",
+ "btc-usdt": "BTC-USDT (Crypto)",
+ "equity_cn": "China A-Shares",
+ "equity_us": "US Equities",
+ "equity_hk": "HK Equities",
+ "crypto": "Crypto",
+ "futures": "Futures"
+ },
+ "themes": {
+ "momentum": "Momentum",
+ "reversal": "Reversal",
+ "volume": "Volume",
+ "volatility": "Volatility",
+ "quality": "Quality",
+ "value": "Value",
+ "liquidity": "Liquidity",
+ "microstructure": "Microstructure",
+ "sentiment": "Sentiment",
+ "growth": "Growth",
+ "leverage": "Leverage"
+ },
+ "compareTooltip": "Tick 2+ alphas below, then compare them head-to-head",
+ "loadingAlpha": "Loading {{id}}…",
+ "comparedRankedBy": "{{count}} compared · ranked by {{sort}} · {{universe}} · {{period}}",
+ "skippedCount": "{{count}} skipped",
+ "gapTitle": "Gap to the leader on {{sort}}",
+ "sortOption": {
+ "ir": "IR (information ratio)",
+ "icMean": "IC mean",
+ "icPositiveRatio": "IC > 0 ratio",
+ "icCount": "Sample count"
+ }
},
"validation": {
"noData": "No validation data available.",
@@ -518,7 +656,9 @@
"failedToCommit": "Failed to commit mandate.",
"noLeverage": "no leverage",
"leverageValue": "{{value}}× leverage",
- "tradesPerDay": "{{count}} trades/day"
+ "tradesPerDay": "{{count}} trades/day",
+ "adjustTitle": "Adjust this mandate",
+ "adjustPlaceholder": "e.g. keep this but raise the daily cap to 10"
},
"messageBubble": {
"copied": "Copied",
@@ -546,7 +686,7 @@
"featureAgent": "AI Agent",
"featureAgentDesc": "Natural language strategy generation with ReAct reasoning",
"featureBacktest": "Built-in Backtest",
- "featureBacktestDesc": "7 data sources across A-shares, US/HK & Crypto",
+ "featureBacktestDesc": "Multiple data sources covering A-shares quantitative analysis",
"featureStreaming": "Real-time Streaming",
"featureStreamingDesc": "Watch the agent think, call tools, and iterate",
"featureReplay": "Strategy Replay",
diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json
index 998aea925..91668fc37 100644
--- a/frontend/src/i18n/locales/zh-CN.json
+++ b/frontend/src/i18n/locales/zh-CN.json
@@ -2,12 +2,17 @@
"app": {
"version": "v0.1.10"
},
+ "charts": {
+ "noPriceData": "暂无价格数据",
+ "noCorrelationData": "暂无相关性数据",
+ "noEquityData": "暂无收益曲线数据"
+ },
"layout": {
"home": "首页",
"agent": "智能体",
"runtime": "运行时",
"reports": "报告",
- "alphaZoo": "Alpha 动物园",
+ "alphaZoo": "Alpha 因子库",
"settings": "设置",
"correlation": "相关性矩阵",
"sessions": "会话",
@@ -117,7 +122,7 @@
"describePrompt": "描述一个交易策略即可开始。",
"tryExample": "试试示例:",
"categories": {
- "multiMarketBacktest": "多市场回测",
+ "multiMarketBacktest": "A股回测",
"researchAnalysis": "研究与分析",
"swarmTeams": "群体智能团队",
"docWebResearch": "文档与网络研究",
@@ -126,46 +131,63 @@
"shadowAccount": "影子账户"
},
"examples": {
- "crossMarketPortfolio": "跨市场组合",
- "crossMarketPortfolioDesc": "A股 + 加密货币 + 美股,风险平价优化器",
- "btcMacd": "BTC 5分钟 MACD 策略",
- "btcMacdDesc": "基于 OKX 实时数据的分钟级加密货币回测",
- "usTechMaxDiv": "美股科技最大分散化",
- "usTechMaxDivDesc": "通过 yfinance 对 FAANG+ 进行投资组合优化",
+ "crossMarketPortfolio": "A股组合优化",
+ "crossMarketPortfolioDesc": "A股组合风险平价优化",
+ "crossMarketPortfolioPrompt": "用000001.SZ、600519.SH、000858.SZ构建风险平价组合,回测2024全年,与等权基准对比",
+ "btcMacd": "A股 MACD 策略",
+ "btcMacdDesc": "基于分钟级数据的A股MACD策略回测",
+ "btcMacdPrompt": "用000001.SZ的5分钟K线做MACD策略回测,快线12慢线26信号线9,近30天",
+ "usTechMaxDiv": "蓝筹股最大分散化",
+ "usTechMaxDivDesc": "蓝筹股最大分散化投资组合",
+ "usTechMaxDivPrompt": "回测600519.SH、000858.SZ、601318.SH、000001.SZ、600036.SH的最大分散化投资组合,2024全年",
"multiFactorAlpha": "多因子 Alpha 模型",
"multiFactorAlphaDesc": "对 300 只股票进行 IC 加权因子合成",
+ "multiFactorAlphaPrompt": "在沪深 300 成分股上利用动量、反转、成交量和波动率构建多因子 Alpha 模型,进行 IC 加权因子合成,回测 2023-2024 年",
"optionsGreeks": "期权希腊字母分析",
"optionsGreeksDesc": "Black-Scholes 定价,Delta/Gamma/Theta/Vega 分析",
+ "optionsGreeksPrompt": "利用 Black-Scholes 计算期权希腊字母:现货=100,执行价=105,无风险利率=3%,波动率=25%,到期时间=90天,分析 Delta/Gamma/Theta/Vega",
"investmentCommittee": "投资委员会评审",
- "investmentCommitteeDesc": "多智能体辩论:多头 vs 空头,风险审查,投资经理决策",
+ "investmentCommitteeDesc": "多智能体 debate:多头 vs 空头,风险审查,投资经理决策",
+ "investmentCommitteePrompt": "[联队模式] 使用 investment_committee 预设评估在当前市场环境下对 600519.SH 进行做多还是做空",
"quantStrategyDesk": "量化策略工作台",
"quantStrategyDeskDesc": "筛选 → 因子研究 → 回测 → 风险审计流水线",
+ "quantStrategyDeskPrompt": "[联队模式] 使用 quant_strategy_desk 预设在沪深 300 成分股中寻找并回测最佳动量策略",
"earningsReport": "分析财报 PDF",
"earningsReportDesc": "上传 PDF 并询问财务问题",
+ "earningsReportPrompt": "总结上传财务报告中的核心财务指标、风险和展望",
"macroResearch": "网络研究:宏观经济展望",
- "macroResearchDesc": "阅读最新网络来源进行宏观分析",
+ "macroResearchDesc": "宏观分析与A股市场展望",
+ "macroResearchPrompt": "阅读最新的央行货币政策报告,总结对 A 股市场的影响",
"analyzeBrokerExport": "分析券商导出数据",
"analyzeBrokerExportDesc": "解析同花顺/东财/富途/通用 CSV —— 持仓天数、胜率、盈亏比、小时分布",
+ "analyzeBrokerExportPrompt": "分析我刚刚上传的交易日志 —— 包含持仓统计、胜率、核心标的以及小时分布的完整画像",
"diagnoseBehavior": "诊断行为偏差",
"diagnoseBehaviorDesc": "处置效应、过度交易、追涨动量、锚定效应 —— 严重程度 + 数值证据",
+ "diagnoseBehaviorPrompt": "对我的交易日志运行 4 项行为诊断(处置效应、过度交易、追涨、锚定),并告诉我哪种偏差最损害我的盈亏",
"checkConnector": "检查已选连接器",
"checkConnectorDesc": "列出连接器配置并验证当前选择",
+ "checkConnectorPrompt": "列出我的交易连接器配置,显示哪一个被选中,然后检查该被选中的连接器。如果未就绪,请明确告诉我缺少什么设置步骤。不要下单或修改订单。",
"analyzePortfolio": "分析连接器投资组合",
"analyzePortfolioDesc": "从已选连接器读取账户摘要和持仓",
+ "analyzePortfolioPrompt": "使用选定的交易连接器配置来总结我的账户、持仓、集中度、现金和组合风险。不要下单或修改订单。",
"quoteTrend": "报价与趋势",
"quoteTrendDesc": "通过已选连接器获取报价和近 30 日日线数据",
+ "quoteTrendPrompt": "使用选定的交易连接器获取 600519.SH 的报价和 30 日日线数据,然后总结当前报价与近期趋势的对比。保持只读。",
"trainShadow": "从日志训练影子账户",
"trainShadowDesc": "从券商 CSV 提取策略规则并持久化影子账户配置",
+ "trainShadowPrompt": "从我刚刚上传的交易日志中训练我的影子账户 —— 展示提取的规则并确认它们符合我的交易习惯",
"shadowDelta": "我少赚了多少?",
"shadowDeltaDesc": "回测影子策略并与实际盈亏进行归因分析",
+ "shadowDeltaPrompt": "运行过去 90 天的影子回测,并细化分析我的实际盈亏与影子账户发生分歧的地方(违反规则、过早退出、错过信号)",
"shadowReport": "生成影子报告",
- "shadowReportDesc": "8 章节 HTML/PDF —— 净值曲线、按市场夏普比率、归因瀑布图"
+ "shadowReportDesc": "8 章节 HTML/PDF —— 净值曲线、按市场夏普比率、归因瀑布图",
+ "shadowReportPrompt": "渲染影子报告并向我提供 URL —— 以你与影子账户的盈亏差距(Delta)为主导"
},
"capabilities": {
"financeSkills": "金融技能库",
"swarmTeams": "群体智能团队",
"autoTools": "自动发现工具",
- "markets": "3 大市场:A股 · 加密货币 · 港美股",
+ "markets": "A股 · 多因子 · 量化",
"connectors": "交易连接器配置",
"timeframes": "分钟级到日线级时间框架",
"optimizers": "4 种投资组合优化器",
@@ -199,6 +221,12 @@
"timeoutSeconds": "超时(秒)",
"maxRetries": "最大重试次数",
"reasoningEffort": "推理强度",
+ "off": "关闭",
+ "reasoningEffortLow": "低",
+ "reasoningEffortMedium": "中",
+ "reasoningEffortHigh": "高",
+ "reasoningEffortMax": "最大",
+ "reasoningEffortDesc": "模型在回答前的思考强度。更高的强度会进行更彻底的推理,但回答速度较慢;选择「关闭」以获得最快的响应速度。",
"useDefaultModel": "使用默认模型",
"useDefaultUrl": "使用默认 URL",
"dataSourcesDesc": "配置回测引擎的外部数据源。",
@@ -214,7 +242,50 @@
"loaderAvailable": "加载器可用",
"noProjectLoader": "无项目加载器",
"pythonPackageInstalled": "Python 包已安装",
- "pythonPackageNotInstalled": "Python 包未安装"
+ "pythonPackageNotInstalled": "Python 包未安装",
+ "localApiAccess": "本地 API 访问",
+ "localApiAccessDesc": "对于远程或专用 Web UI 部署,请在浏览器中输入一次服务器 API 密钥。本地主机(localhost)使用可保持为空。",
+ "serverApiKey": "服务器 API 密钥",
+ "storedInBrowser": "仅存储在此浏览器中。留空以清除它。",
+ "localApiKeySaved": "本地 API 密钥已保存",
+ "subtitle": "配置此本地项目的模型凭证和市场数据源 Token。",
+ "unavailable": "设置不可用",
+ "llmSettings": "LLM 设置",
+ "llmSettingsDesc": "选择智能体使用的模型,并将其保存到项目本地的 agent/.env 文件中。",
+ "connection": "连接",
+ "model": "模型",
+ "useProviderDefaults": "使用提供商默认设置",
+ "modelIdHint": "使用提供商所需的准确模型 ID。",
+ "clearApiKey": "清除已保存的 API 密钥",
+ "generation": "生成设置",
+ "dataSourceSettings": "数据源设置",
+ "dataSourceSettingsDesc": "配置回测引擎和研究智能体使用的可选市场数据凭证。",
+ "tushareToken": "Tushare Token",
+ "clearTushareToken": "清除已保存的 Tushare Token",
+ "saveDataSourceSettings": "保存数据源设置",
+ "baostock": "BaoStock",
+ "loadLlmSettingsFailed": "加载 LLM 设置失败: {{message}}",
+ "loadDataSourceSettingsFailed": "加载数据源设置失败: {{message}}",
+ "llmSettingsSaved": "LLM 设置已保存",
+ "saveLlmSettingsFailed": "保存 LLM 设置失败: {{message}}",
+ "dataSourceSettingsSaved": "数据源设置已保存",
+ "saveDataSourceSettingsFailed": "保存数据源设置失败: {{message}}",
+ "configured": "已配置",
+ "keepCurrentKey": "留空以保留当前密钥",
+ "providerUsesOauth": "该提供商使用 OAuth。请运行: {{command}}",
+ "noApiKeyRequired": "此提供商不需要 API 密钥。",
+ "keepCurrentToken": "留空以保留当前 Token",
+ "iwencaiApiKey": "iWenCai API 密钥",
+ "fredApiKey": "FRED API 密钥",
+ "iwencaiDesc": "用于通过 iWenCai (问财) 进行语义化选股。需要免费的访问密钥。",
+ "clearSavedKey": "清除已保存的密钥",
+ "fredDesc": "用于 FRED 宏观经济数据(CPI、GDP、失业率等)。从 fred.stlouisfed.org 获取的免费密钥。",
+ "featureFlags": "功能开关 (Feature Flags)",
+ "featureFlagsDesc": "从环境变量中检测到的运行时功能开关。",
+ "shellTools": "Shell 工具",
+ "scheduler": "调度器 (Scheduler)",
+ "sessionRuntime": "会话运行时",
+ "flagsReadFrom": "功能开关从 {{env_path}} 中的 {{env1}}、{{env2}} 和 {{env3}} 读取。"
},
"agent": {
"connectionLostReconnect": "连接已断开,正在重连…",
@@ -259,7 +330,18 @@
"uploaded": "已上传:{{filename}}",
"uploadFailed": "上传失败:{{error}}",
"failedToSend": "发送消息失败,请重试。",
- "failedToContinue": "继续目标失败,请重试。"
+ "failedToContinue": "继续目标失败,请重试。",
+ "runtimeBadge": "运行时",
+ "activeResearchGoal": "活跃的研究目标",
+ "evidenceCollectedTitle": "为此研究目标收集的证据",
+ "evidenceCount": "{{count}} 条证据",
+ "uploading": "上传中...",
+ "haltConnectorTitle": "立即停止连接器运行时活动",
+ "haltConnector": "停止连接器运行时",
+ "moreOptions": "更多选项",
+ "uploadPdf": "上传 PDF 文档",
+ "researchGoal": "研究目标",
+ "agentSwarm": "智能体蜂群"
},
"runDetail": {
"title": "运行详情",
@@ -341,21 +423,24 @@
"correlation": {
"title": "相关性矩阵",
"assetCodes": "资产代码",
- "assetCodesHint": "逗号分隔的标的代码,如 BTC-USDT,ETH-USDT,AAPL,SPY",
+ "assetCodesHint": "逗号分隔的标的代码,如 000001.SZ,600519.SH,000858.SZ",
"windowDays": "窗口(天)",
"method": "方法",
+ "method_pearson": "皮尔逊相关",
+ "method_spearman": "斯皮尔曼秩相关",
"compute": "计算",
- "loading": "加载中..."
+ "loading": "计算中...",
+ "failedToCompute": "计算相关性失败"
},
"alphaZoo": {
- "title": "Alpha 动物园",
- "prebuiltAlpha": "{{count}} 个预构建量化 Alpha,覆盖 4 个动物园",
- "prebuiltAlphaLoading": "预构建量化 Alpha,覆盖 4 个动物园",
- "browseDesc": "浏览来自 Qlib、Kakushadze 101 公式集、GTJA 191 以及学术异象文献的公式驱动截面信号。点击任意 Alpha 查看公式和源码,或运行基准测试在特定市场和时间段上评分整个动物园。",
+ "title": "Alpha 因子库",
+ "prebuiltAlpha": "{{count}} 个预构建量化 Alpha,覆盖 4 大因子集",
+ "prebuiltAlphaLoading": "预构建量化 Alpha,覆盖 4 大因子集",
+ "browseDesc": "浏览来自 Qlib、Kakushadze 101 公式集、GTJA 191 以及学术异象文献的公式驱动截面信号。点击任意 Alpha 查看公式和源码,或运行基准测试在指定标的池和时间段上对整个因子库进行评测。",
"search": "搜索",
"searchPlaceholder": "按 ID 或昵称筛选…",
- "zoo": "动物园",
- "allZoos": "全部动物园",
+ "zoo": "因子集",
+ "allZoos": "全部因子集",
"theme": "主题",
"allThemes": "全部主题",
"universe": "标的池",
@@ -368,7 +453,7 @@
"noAlphasMatch": "没有匹配当前筛选条件的 Alpha。",
"showingOf": "显示 {{visible}} / {{total}}",
"loadMore": "加载更多",
- "backToAlphaZoo": "返回 Alpha 动物园",
+ "backToAlphaZoo": "返回 Alpha 因子库",
"couldNotLoad": "无法加载 Alpha",
"unknownError": "未知错误",
"formula": "公式",
@@ -385,8 +470,8 @@
"viewSource": "查看源码({{lines}} 行)",
"noSource": "(无源码)",
"benchRunner": "基准测试运行器",
- "scoreZoo": "在标的池上评分整个动物园",
- "scoreDesc": "对所选动物园中每个 Alpha 在指定标的池和时间段上计算 IC / IR,然后将它们分为存活 / 反转 / 失效。",
+ "scoreZoo": "在标的池上对整个因子集进行评测",
+ "scoreDesc": "对所选因子集中每个 Alpha 在指定标的池和时间段上计算 IC / IR,然后将它们分为存活 / 反转 / 失效。",
"period": "时间段",
"top": "Top",
"running": "运行中…",
@@ -405,7 +490,7 @@
"category": "分类",
"headToHeadCompare": "头对头对比",
"compareAlphas": "并排对比 Alpha",
- "compareDesc": "仅在标的池和时间段上对您选择的 Alpha 进行基准测试,然后按 IC / IR 排名并显示与领先者的差距——当您只关心短名单时,比测试整个动物园快得多。",
+ "compareDesc": "仅在标的池和时间段上对您选择的 Alpha 进行基准测试,然后按 IC / IR 排名并显示与领先者的差距——当您只关心精选名单时,比测试整个因子库快得多。",
"alphaIds": "Alpha ID",
"selected": "{{count}} 个已选",
"alphaIdsHint": "用逗号或空格分隔 ID。提示:在目录中勾选 Alpha 并点击\"对比\"可自动填充。",
@@ -421,8 +506,62 @@
"icPositiveTitle": "IC 为正的期数占比",
"sampleCount": "样本数",
"sampleCountTitle": "IC 样本数量",
- "noBenchmarkMatch": "无基准匹配"
+ "noBenchmarkMatch": "无基准匹配",
+ "alphaCatalogue": "Alpha 目录",
+ "predictiveHalfLifeTitle": "预测半衰期:信号边缘衰减前的交易日数",
+ "id": "ID",
+ "icSampleCount": "IC 样本数量",
+ "alpha": "Alpha",
+ "alphaComparisonRanking": "Alpha 对比排名",
+ "skippedPre": "跳过:",
+ "zooCardTitle": {
+ "qlib158": "Qlib 158",
+ "alpha101": "Kakushadze 101 公式化 Alpha",
+ "gtja191": "国泰君安 191",
+ "academic": "学术文献异象因子"
+ },
+ "zooCardDesc": {
+ "qlib158": "微软 Qlib 完整的 158 特征库,涵盖动量、波动率、成交量及滚动统计信号。",
+ "alpha101": "来自 Kakushadze(2015)的 101 个公式化 Alpha 信号;短周期截面信号。",
+ "gtja191": "国泰君安证券的 191 个 Alpha;专门针对中国 A 股市场优化的技术面与微观结构信号。",
+ "academic": "来自学术文献的长期异象因子精选(价值、动量、质量、低波动率等)。"
+ },
+ "universeOption": {
+ "csi300": "沪深 300(A 股)",
+ "sp500": "标普 500(美股)",
+ "btc-usdt": "BTC-USDT(加密货币)",
+ "equity_cn": "A 股",
+ "equity_us": "美股",
+ "equity_hk": "港股",
+ "crypto": "加密货币",
+ "futures": "期货"
+ },
+ "themes": {
+ "momentum": "动量",
+ "reversal": "反转",
+ "volume": "成交量",
+ "volatility": "波动率",
+ "quality": "质量",
+ "value": "价值",
+ "liquidity": "流动性",
+ "microstructure": "微观结构",
+ "sentiment": "情绪",
+ "growth": "成长",
+ "leverage": "杠杆"
+ },
+ "compareTooltip": "在下方勾选 2 个或更多 Alpha,然后进行头对头对比",
+ "loadingAlpha": "正在加载 {{id}}…",
+ "comparedRankedBy": "已对比 {{count}} 个 · 按 {{sort}} 排名 · {{universe}} · {{period}}",
+ "skippedCount": "跳过 {{count}} 个",
+ "gapTitle": "与领先者在 {{sort}} 上的差距",
+ "sortOption": {
+ "ir": "IR(信息比率)",
+ "icMean": "IC 均值",
+ "icPositiveRatio": "IC > 0 期占比",
+ "icCount": "样本数量"
+ }
},
+
"validation": {
"noData": "暂无验证数据。",
"monteCarlo": "蒙特卡罗置换检验",
@@ -518,7 +657,9 @@
"failedToCommit": "提交 mandate 失败。",
"noLeverage": "无杠杆",
"leverageValue": "{{value}}× 杠杆",
- "tradesPerDay": "{{count}} 笔/天"
+ "tradesPerDay": "{{count}} 笔/天",
+ "adjustTitle": "调整此 mandate",
+ "adjustPlaceholder": "例如:保留当前设置但将每日交易次数上限提高到 10 次"
},
"messageBubble": {
"copied": "已复制",
@@ -546,7 +687,7 @@
"featureAgent": "AI 智能体",
"featureAgentDesc": "基于 ReAct 推理的自然语言策略生成",
"featureBacktest": "内置回测引擎",
- "featureBacktestDesc": "7 大数据源,覆盖 A股、港美股与加密货币",
+ "featureBacktestDesc": "多数据源覆盖A股量化分析",
"featureStreaming": "实时流式输出",
"featureStreamingDesc": "观看智能体思考、调用工具和迭代的全过程",
"featureReplay": "策略回放",
diff --git a/frontend/src/pages/Agent.tsx b/frontend/src/pages/Agent.tsx
index ccd90c773..e41918c48 100644
--- a/frontend/src/pages/Agent.tsx
+++ b/frontend/src/pages/Agent.tsx
@@ -111,6 +111,7 @@ function liveActionLabel(action: LiveAction): string {
}
function LiveActionChip({ action }: { action: LiveAction }) {
+ const { t } = useTranslation();
const { icon: Icon, tone } = liveActionStyle(action.kind);
return (
<div className="flex gap-3">
@@ -118,7 +119,7 @@ function LiveActionChip({ action }: { action: LiveAction }) {
<div className="flex-1 min-w-0">
<div className={["inline-flex max-w-full flex-wrap items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs", tone].join(" ")}>
<Icon className="h-3 w-3 shrink-0" />
- <span className="shrink-0 font-medium uppercase tracking-wide text-[10px]">RUNTIME</span>
+ <span className="shrink-0 font-medium uppercase tracking-wide text-[10px]">{t("agent.runtimeBadge")}</span>
<span className="shrink-0 font-medium">{liveActionLabel(action)}</span>
{action.intent_normalized && (
<span className="truncate text-foreground/80">· {action.intent_normalized}</span>
@@ -1294,7 +1295,7 @@ export function Agent() {
<div className="flex items-center gap-1">
<span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary/10 text-primary text-xs font-medium">
<Target className="h-3 w-3" />
- New Research Goal
+ {t("agent.newResearchGoal")}
<button type="button" onClick={() => setGoalComposerActive(false)} className="hover:text-destructive transition-colors">
<X className="h-3 w-3" />
</button>
@@ -1308,7 +1309,7 @@ export function Agent() {
onClick={() => setGoalDetailsOpen((open) => !open)}
className="inline-flex max-w-full items-center gap-1.5 justify-self-start rounded-lg bg-primary/10 px-2.5 py-1 text-left text-xs font-medium text-primary transition-colors hover:bg-primary/15"
title={goalSnapshot.goal.objective}
- aria-label="Active research goal"
+ aria-label={t("agent.activeResearchGoal")}
aria-expanded={goalDetailsOpen}
>
<Target className="h-3 w-3 shrink-0" />
@@ -1322,8 +1323,8 @@ export function Agent() {
</span>
)}
{goalProgress.evidenceTotal > 0 && (
- <span className="shrink-0 rounded bg-background px-1 font-mono text-[10px] text-primary" title="Evidence collected toward this research goal">
- {goalProgress.evidenceTotal} evidence
+ <span className="shrink-0 rounded bg-background px-1 font-mono text-[10px] text-primary" title={t("agent.evidenceCollectedTitle")}>
+ {t("agent.evidenceCount", { count: goalProgress.evidenceTotal })}
</span>
)}
<ChevronDown
@@ -1351,7 +1352,7 @@ export function Agent() {
className="inline-flex items-center gap-1 rounded-lg border px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground"
>
<X className="h-3 w-3" />
- Cancel
+ {t("agent.cancel")}
</button>
<button
type="button"
@@ -1360,7 +1361,7 @@ export function Agent() {
className="inline-flex items-center gap-1 rounded-lg bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground transition-opacity disabled:opacity-40"
>
<Check className="h-3 w-3" />
- Save
+ {t("agent.save")}
</button>
</div>
</div>
@@ -1372,7 +1373,7 @@ export function Agent() {
<div className="grid grid-cols-2 gap-2">
<div className="rounded-lg border bg-muted/20 p-2.5">
<div className="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">
- Criteria
+ {t("agent.criteria")}
</div>
<div className="mt-1 font-mono text-base font-semibold text-foreground">
{goalProgress.label || "0/0"}
@@ -1380,7 +1381,7 @@ export function Agent() {
</div>
<div className="rounded-lg border bg-muted/20 p-2.5">
<div className="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">
- Evidence
+ {t("agent.evidence")}
</div>
<div className="mt-1 font-mono text-base font-semibold text-foreground">
{goalProgress.evidenceTotal}
@@ -1417,7 +1418,7 @@ export function Agent() {
{goalSnapshot.evidence.length > 0 && (
<div className="grid gap-1.5 border-t pt-2">
<div className="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">
- Recent Evidence
+ {t("agent.recentEvidence")}
</div>
{latestGoalEvidence(goalSnapshot).map((item) => (
<div key={item.evidence_id} className="rounded-lg bg-muted/20 px-2 py-1.5">
@@ -1440,7 +1441,7 @@ export function Agent() {
className="inline-flex items-center gap-1 rounded-lg border px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40"
>
<Play className="h-3 w-3" />
- Continue
+ {t("agent.continue")}
</button>
<button
type="button"
@@ -1449,7 +1450,7 @@ export function Agent() {
className="inline-flex items-center gap-1 rounded-lg border px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40"
>
<Pencil className="h-3 w-3" />
- Edit
+ {t("agent.edit")}
</button>
<button
type="button"
@@ -1457,7 +1458,7 @@ export function Agent() {
className="inline-flex items-center gap-1 rounded-lg border px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:border-destructive/40 hover:text-destructive"
>
<X className="h-3 w-3" />
- Cancel Goal
+ {t("agent.cancelGoal")}
</button>
</div>
</div>
@@ -1488,7 +1489,7 @@ export function Agent() {
{uploading && (
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
<Loader2 className="h-3 w-3 animate-spin" />
- Uploading...
+ {t("agent.uploading")}
</div>
)}
{/* Persistent kill switch — distinct from the per-turn Stop button
@@ -1498,7 +1499,7 @@ export function Agent() {
{liveIsHalted ? (
<span className="inline-flex items-center gap-1.5 rounded-lg bg-destructive/10 px-2.5 py-1 text-xs font-medium text-destructive">
<OctagonX className="h-3 w-3" />
- Connector runtime halted
+ {t("agent.connectorHalted")}
</span>
) : (
<button
@@ -1506,10 +1507,10 @@ export function Agent() {
onClick={handleHaltLive}
disabled={halting}
className="inline-flex items-center gap-1.5 rounded-lg border border-destructive/40 bg-destructive/5 px-2.5 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-40"
- title="Instantly halt connector runtime activity"
+ title={t("agent.haltConnectorTitle")}
>
{halting ? <Loader2 className="h-3 w-3 animate-spin" /> : <OctagonX className="h-3 w-3" />}
- Halt connector runtime
+ {t("agent.haltConnector")}
</button>
)}
</div>
@@ -1522,7 +1523,7 @@ export function Agent() {
onClick={() => setShowUploadMenu(prev => !prev)}
disabled={status === "streaming" || uploading}
className="w-9 h-9 rounded-full border flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors disabled:opacity-40 shrink-0"
- title="More options"
+ title={t("agent.moreOptions")}
>
<Plus className="h-4 w-4" />
</button>
@@ -1534,7 +1535,7 @@ export function Agent() {
className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"
>
<Paperclip className="h-4 w-4" />
- Upload PDF document
+ {t("agent.uploadPdf")}
</button>
<div className="border-t my-1" />
<button
@@ -1548,7 +1549,7 @@ export function Agent() {
className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"
>
<Target className="h-4 w-4" />
- Research Goal
+ {t("agent.researchGoal")}
</button>
<button
type="button"
@@ -1561,7 +1562,7 @@ export function Agent() {
className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"
>
<Users className="h-4 w-4" />
- Agent Swarm
+ {t("agent.agentSwarm")}
</button>
<div className="border-t my-1" />
<button
@@ -1573,7 +1574,7 @@ export function Agent() {
className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"
>
<Landmark className="h-4 w-4" />
- Check Trading Connector
+ {t("agent.checkConnector")}
</button>
<button
type="button"
@@ -1584,7 +1585,7 @@ export function Agent() {
className="w-full px-3 py-2 text-left text-sm hover:bg-muted transition-colors flex items-center gap-2"
>
<Landmark className="h-4 w-4" />
- Analyze Connector Portfolio
+ {t("agent.analyzePortfolio")}
</button>
</div>
)}
@@ -1630,8 +1631,8 @@ export function Agent() {
}}
placeholder={
goalComposerActive
- ? "Describe the research goal to attach to this session"
- : "e.g. Create a dual MA crossover strategy for 000001.SZ, backtest 2024"
+ ? t("agent.describeGoal")
+ : t("agent.placeholder")
}
className="flex-1 px-4 py-2.5 rounded-xl border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/40 transition-shadow resize-none max-h-32 overflow-y-auto"
disabled={status === "streaming"}
diff --git a/frontend/src/pages/AlphaZoo.tsx b/frontend/src/pages/AlphaZoo.tsx
index 8ccf9eed6..2ceaa8462 100644
--- a/frontend/src/pages/AlphaZoo.tsx
+++ b/frontend/src/pages/AlphaZoo.tsx
@@ -212,7 +212,7 @@ function BrowseView() {
{/* Hero */}
<div className="space-y-2">
<div className="flex items-center gap-2 text-xs text-muted-foreground uppercase tracking-wide">
- <Layers className="h-3.5 w-3.5" aria-hidden="true" /> Alpha Zoo
+ <Layers className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.title")}
</div>
<h1 className="text-2xl md:text-3xl font-bold tracking-tight">
{loading
@@ -220,10 +220,7 @@ function BrowseView() {
: i18n.t("alphaZoo.prebuiltAlpha", { count: total })}
</h1>
<p className="text-sm text-muted-foreground max-w-2xl">
- Browse formula-driven cross-sectional signals from Qlib, the
- Kakushadze 101 set, GTJA 191, and the academic anomaly literature.
- Click any alpha to read its formula and source code, or run a bench
- to score the whole zoo on a universe and period.
+ {i18n.t("alphaZoo.browseDesc")}
</p>
</div>
@@ -249,9 +246,9 @@ function BrowseView() {
{z.approxCount}
</span>
</div>
- <h3 className="font-semibold text-sm leading-tight">{z.title}</h3>
+ <h3 className="font-semibold text-sm leading-tight">{i18n.t("alphaZoo.zooCardTitle." + z.id)}</h3>
<p className="text-xs text-muted-foreground line-clamp-3">
- {z.description}
+ {i18n.t("alphaZoo.zooCardDesc." + z.id)}
</p>
</button>
);
@@ -262,7 +259,7 @@ function BrowseView() {
<div className="flex flex-col md:flex-row md:items-end gap-3 border rounded-xl p-4 bg-card">
<div className="flex-1 min-w-0">
<label htmlFor="alpha-search" className="text-xs text-muted-foreground block mb-1">
- Search
+ {i18n.t("alphaZoo.search")}
</label>
<div className="relative">
<Search
@@ -276,30 +273,30 @@ function BrowseView() {
setSearch(e.target.value);
setVisibleCount(PAGE_SIZE);
}}
- placeholder="Filter by id or nickname…"
+ placeholder={i18n.t("alphaZoo.searchPlaceholder")}
className="w-full pl-9 pr-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"
/>
</div>
</div>
<div className="md:w-40">
- <label htmlFor="alpha-zoo-filter" className="text-xs text-muted-foreground block mb-1">Zoo</label>
+ <label htmlFor="alpha-zoo-filter" className="text-xs text-muted-foreground block mb-1">{i18n.t("alphaZoo.zoo")}</label>
<select
id="alpha-zoo-filter"
value={zooFilter}
onChange={(e) => setZooFilter(e.target.value)}
className="w-full px-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"
>
- <option value="">All zoos</option>
+ <option value="">{i18n.t("alphaZoo.allZoos")}</option>
{ZOO_CARDS.map((z) => (
<option key={z.id} value={z.id}>
- {z.title}
+ {i18n.t("alphaZoo.zooCardTitle." + z.id)}
</option>
))}
</select>
</div>
<div className="md:w-40">
<label htmlFor="alpha-theme-filter" className="text-xs text-muted-foreground block mb-1">
- Theme
+ {i18n.t("alphaZoo.theme")}
</label>
<select
id="alpha-theme-filter"
@@ -307,17 +304,17 @@ function BrowseView() {
onChange={(e) => setThemeFilter(e.target.value)}
className="w-full px-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"
>
- <option value="">All themes</option>
+ <option value="">{i18n.t("alphaZoo.allThemes")}</option>
{themeOptions.map((tname) => (
<option key={tname} value={tname}>
- {tname}
+ {i18n.t("alphaZoo.themes." + tname, { defaultValue: tname })}
</option>
))}
</select>
</div>
<div className="md:w-44">
<label htmlFor="alpha-universe-filter" className="text-xs text-muted-foreground block mb-1">
- Universe
+ {i18n.t("alphaZoo.universe")}
</label>
<select
id="alpha-universe-filter"
@@ -325,10 +322,10 @@ function BrowseView() {
onChange={(e) => setUniverseFilter(e.target.value)}
className="w-full px-3 py-2 rounded-lg border bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"
>
- <option value="">All universes</option>
+ <option value="">{i18n.t("alphaZoo.allUniverses")}</option>
{UNIVERSE_OPTIONS.map((u) => (
<option key={u.value} value={u.value}>
- {u.label}
+ {i18n.t("alphaZoo.universeOption." + u.value)}
</option>
))}
</select>
@@ -336,16 +333,16 @@ function BrowseView() {
<Link
to={compareHref}
className="inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border text-sm font-medium hover:bg-muted hover:text-foreground transition"
- title="Tick 2+ alphas below, then compare them head-to-head"
+ title={i18n.t("alphaZoo.compareTooltip")}
>
- <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> Compare
+ <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.compare")}
{selected.size >= 2 ? ` (${selected.size})` : ""}
</Link>
<Link
to="/alpha-zoo/bench"
className="inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition"
>
- <Play className="h-3.5 w-3.5" aria-hidden="true" /> Run benchmark
+ <Play className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.runBenchmark")}
</Link>
</div>
@@ -353,27 +350,27 @@ function BrowseView() {
{/* TODO(v0.2): switch to react-window if alpha count exceeds 5000 */}
<div className="border rounded-xl overflow-hidden">
<div className="overflow-x-auto">
- <table className="w-full text-sm" aria-label="Alpha catalogue">
- <caption className="sr-only">Alpha catalogue</caption>
+ <table className="w-full text-sm" aria-label={i18n.t("alphaZoo.alphaCatalogue")}>
+ <caption className="sr-only">{i18n.t("alphaZoo.alphaCatalogue")}</caption>
<thead>
<tr className="border-b bg-muted/40">
<th className="w-10 px-3 py-2.5">
- <span className="sr-only">Select for compare</span>
+ <span className="sr-only">{i18n.t("alphaZoo.selectForCompare")}</span>
</th>
<th className="text-left px-4 py-2.5 text-muted-foreground">
- ID
+ {i18n.t("alphaZoo.id")}
</th>
<th className="text-left px-4 py-2.5 text-muted-foreground">
- Zoo
+ {i18n.t("alphaZoo.zoo")}
</th>
<th className="text-left px-4 py-2.5 text-muted-foreground">
- Theme
+ {i18n.t("alphaZoo.theme")}
</th>
<th className="text-left px-4 py-2.5 text-muted-foreground hidden md:table-cell">
- Universe
+ {i18n.t("alphaZoo.universe")}
</th>
- <th className="text-right px-4 py-2.5 text-muted-foreground" title="Predictive half-life: trading days before the signal's edge decays">
- Decay (days)
+ <th className="text-right px-4 py-2.5 text-muted-foreground" title={i18n.t("alphaZoo.predictiveHalfLifeTitle")}>
+ {i18n.t("alphaZoo.decayDays")}
</th>
</tr>
</thead>
@@ -382,13 +379,13 @@ function BrowseView() {
<tr>
<td colSpan={6} className="px-4 py-8 text-center text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin inline mr-2" aria-hidden="true" />
- Loading alphas…
+ {i18n.t("alphaZoo.loadingAlphas")}
</td>
</tr>
) : visible.length === 0 ? (
<tr>
<td colSpan={6} className="px-4 py-8 text-center text-muted-foreground">
- No alphas match the current filters.
+ {i18n.t("alphaZoo.noAlphasMatch")}
</td>
</tr>
) : (
@@ -424,10 +421,10 @@ function BrowseView() {
</td>
<td className="px-4 py-2 text-xs">{a.zoo}</td>
<td className="px-4 py-2 text-xs text-muted-foreground">
- {(a.theme || []).join(", ") || "—"}
+ {(a.theme || []).map((t) => i18n.t("alphaZoo.themes." + t, { defaultValue: t })).join(", ") || "—"}
</td>
<td className="px-4 py-2 text-xs text-muted-foreground hidden md:table-cell">
- {(a.universe || []).join(", ") || "—"}
+ {(a.universe || []).map((u) => i18n.t("alphaZoo.universeOption." + u, { defaultValue: u })).join(", ") || "—"}
</td>
<td className="px-4 py-2 text-right font-mono tabular-nums text-xs">
{a.decay_horizon ?? "—"}
@@ -441,14 +438,14 @@ function BrowseView() {
{!loading && visible.length < filtered.length && (
<div className="border-t p-3 flex items-center justify-between text-xs text-muted-foreground">
<span>
- Showing {visible.length} of {filtered.length}
+ {i18n.t("alphaZoo.showingOf", { visible: visible.length, total: filtered.length })}
</span>
<button
type="button"
onClick={() => setVisibleCount((c) => c + PAGE_SIZE)}
className="px-3 py-1 rounded-md border hover:bg-muted hover:text-foreground transition"
>
- Load more
+ {i18n.t("alphaZoo.loadMore")}
</button>
</div>
)}
@@ -494,7 +491,7 @@ function DetailView({ alphaId }: DetailProps) {
if (loading) {
return (
<div className="p-8 flex items-center justify-center text-muted-foreground">
- <Loader2 className="h-4 w-4 animate-spin mr-2" aria-hidden="true" /> Loading {alphaId}…
+ <Loader2 className="h-4 w-4 animate-spin mr-2" aria-hidden="true" /> {i18n.t("alphaZoo.loadingAlpha", { id: alphaId })}
</div>
);
}
@@ -503,13 +500,13 @@ function DetailView({ alphaId }: DetailProps) {
return (
<div className="p-8 max-w-3xl mx-auto space-y-4">
<Link to="/alpha-zoo" className="text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1">
- <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> Back to Alpha Zoo
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.backToAlphaZoo")}
</Link>
<div className="border rounded-xl p-6 bg-card">
<h2 className="font-semibold text-sm mb-1 flex items-center gap-2">
- <AlertTriangle className="h-4 w-4 text-warning" aria-hidden="true" /> Could not load alpha
+ <AlertTriangle className="h-4 w-4 text-warning" aria-hidden="true" /> {i18n.t("alphaZoo.couldNotLoad")}
</h2>
- <p className="text-sm text-muted-foreground">{error || "Unknown error"}</p>
+ <p className="text-sm text-muted-foreground">{error || i18n.t("alphaZoo.unknownError")}</p>
</div>
</div>
);
@@ -534,14 +531,14 @@ function DetailView({ alphaId }: DetailProps) {
to="/alpha-zoo"
className="text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1"
>
- <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> Back to Alpha Zoo
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.backToAlphaZoo")}
</Link>
<button
type="button"
onClick={() => navigate(benchHref)}
className="inline-flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-xs font-medium hover:opacity-90 transition"
>
- <Play className="h-3.5 w-3.5" aria-hidden="true" /> Run benchmark
+ <Play className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.runBenchmark")}
</button>
</div>
@@ -564,7 +561,7 @@ function DetailView({ alphaId }: DetailProps) {
<section className="space-y-2">
<h2 className="text-sm font-medium text-muted-foreground">{i18n.t("alphaZoo.formula")}</h2>
<pre className="border rounded-xl bg-muted/30 p-4 overflow-x-auto text-xs leading-relaxed">
- <code>{formulaLatex || "(no formula provided)"}</code>
+ <code>{formulaLatex || i18n.t("alphaZoo.noFormula")}</code>
</pre>
</section>
@@ -574,14 +571,32 @@ function DetailView({ alphaId }: DetailProps) {
<div className="border rounded-xl overflow-hidden">
<table className="w-full text-sm">
<tbody>
- <MetaRow label="Theme" value={metaString(meta, "theme")} />
- <MetaRow label="Universe" value={metaString(meta, "universe")} />
- <MetaRow label="Frequency" value={metaString(meta, "frequency")} />
- <MetaRow label="Decay horizon" value={metaString(meta, "decay_horizon")} />
- <MetaRow label="Min warm-up bars" value={metaString(meta, "min_warmup_bars")} />
- <MetaRow label="Requires sector" value={metaString(meta, "requires_sector")} />
- <MetaRow label="Module path" value={a.module_path || "—"} />
- <MetaRow label="Notes" value={metaString(meta, "notes")} last />
+ <MetaRow
+ label={i18n.t("alphaZoo.theme")}
+ value={
+ Array.isArray(meta.theme)
+ ? meta.theme.map((t: string) => i18n.t("alphaZoo.themes." + t, { defaultValue: t })).join(", ")
+ : typeof meta.theme === "string"
+ ? i18n.t("alphaZoo.themes." + meta.theme, { defaultValue: meta.theme })
+ : "—"
+ }
+ />
+ <MetaRow
+ label={i18n.t("alphaZoo.universe")}
+ value={
+ Array.isArray(meta.universe)
+ ? meta.universe.map((u: string) => i18n.t("alphaZoo.universeOption." + u, { defaultValue: u })).join(", ")
+ : typeof meta.universe === "string"
+ ? i18n.t("alphaZoo.universeOption." + meta.universe, { defaultValue: meta.universe })
+ : "—"
+ }
+ />
+ <MetaRow label={i18n.t("alphaZoo.frequency")} value={metaString(meta, "frequency")} />
+ <MetaRow label={i18n.t("alphaZoo.decayHorizon")} value={metaString(meta, "decay_horizon")} />
+ <MetaRow label={i18n.t("alphaZoo.minWarmupBars")} value={metaString(meta, "min_warmup_bars")} />
+ <MetaRow label={i18n.t("alphaZoo.requiresSector")} value={metaString(meta, "requires_sector")} />
+ <MetaRow label={i18n.t("alphaZoo.modulePath")} value={a.module_path || "—"} />
+ <MetaRow label={i18n.t("alphaZoo.notes")} value={metaString(meta, "notes")} last />
</tbody>
</table>
</div>
@@ -592,10 +607,10 @@ function DetailView({ alphaId }: DetailProps) {
<h2 className="text-sm font-medium text-muted-foreground">{i18n.t("alphaZoo.sourceCode")}</h2>
<details className="border rounded-xl bg-card group">
<summary className="cursor-pointer px-4 py-3 text-sm font-medium hover:bg-muted/40 select-none">
- View source ({(detail.source_code || "").split("\n").length} lines)
+ {i18n.t("alphaZoo.viewSource", { lines: (detail.source_code || "").split("\n").length })}
</summary>
<pre className="border-t bg-muted/30 p-4 overflow-x-auto text-xs leading-relaxed">
- <code>{detail.source_code || "(no source available)"}</code>
+ <code>{detail.source_code || i18n.t("alphaZoo.noSource")}</code>
</pre>
</details>
</section>
@@ -755,19 +770,18 @@ function BenchView() {
to="/alpha-zoo"
className="text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1"
>
- <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> Back to Alpha Zoo
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.backToAlphaZoo")}
</Link>
<div className="space-y-1">
<div className="flex items-center gap-2 text-xs text-muted-foreground uppercase tracking-wide">
- <Play className="h-3.5 w-3.5" aria-hidden="true" /> Benchmark runner
+ <Play className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.benchRunner")}
</div>
<h1 className="text-2xl md:text-3xl font-bold tracking-tight">
- Score a zoo on a universe
+ {i18n.t("alphaZoo.scoreZoo")}
</h1>
<p className="text-sm text-muted-foreground max-w-2xl">
- Computes IC / IR for every alpha in the selected zoo over the chosen
- universe and period, then bucketizes them as alive / reversed / dead.
+ {i18n.t("alphaZoo.scoreDesc")}
</p>
</div>
@@ -777,7 +791,7 @@ function BenchView() {
className="border rounded-xl p-4 bg-card grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-3 items-end"
>
<div>
- <label htmlFor="bench-zoo" className="text-xs text-muted-foreground block mb-1">Zoo</label>
+ <label htmlFor="bench-zoo" className="text-xs text-muted-foreground block mb-1">{i18n.t("alphaZoo.zoo")}</label>
<select
id="bench-zoo"
value={zoo}
@@ -787,13 +801,13 @@ function BenchView() {
>
{ZOO_CARDS.map((z) => (
<option key={z.id} value={z.id}>
- {z.title}
+ {i18n.t("alphaZoo.zooCardTitle." + z.id)}
</option>
))}
</select>
</div>
<div>
- <label htmlFor="bench-universe" className="text-xs text-muted-foreground block mb-1">Universe</label>
+ <label htmlFor="bench-universe" className="text-xs text-muted-foreground block mb-1">{i18n.t("alphaZoo.universe")}</label>
<select
id="bench-universe"
value={universe}
@@ -803,7 +817,7 @@ function BenchView() {
>
{UNIVERSE_OPTIONS.map((u) => (
<option key={u.value} value={u.value}>
- {u.label}
+ {i18n.t("alphaZoo.universeOption." + u.value)}
</option>
))}
</select>
@@ -844,11 +858,11 @@ function BenchView() {
>
{busy ? (
<>
- <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden="true" /> Running…
+ <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden="true" /> {i18n.t("alphaZoo.running")}
</>
) : (
<>
- <Play className="h-3.5 w-3.5" aria-hidden="true" /> Run benchmark
+ <Play className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.runBenchmark")}
</>
)}
</button>
@@ -905,7 +919,7 @@ function ProgressPanel({
</div>
{progress?.current_alpha_id && (
<p className="text-xs text-muted-foreground font-mono truncate">
- Computing: {progress.current_alpha_id}
+ {i18n.t("alphaZoo.computing", { id: progress.current_alpha_id })}
</p>
)}
</div>
@@ -929,7 +943,7 @@ function ResultPanel({ result }: { result: AlphaBenchResult }) {
backgroundColor: "transparent",
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
legend: {
- data: ["Alive", "Reversed", "Dead"],
+ data: [i18n.t("alphaZoo.alive"), i18n.t("alphaZoo.reversed"), i18n.t("alphaZoo.dead")],
textStyle: { color: theme.textColor, fontSize: 11 },
right: 8,
top: 4,
@@ -937,7 +951,7 @@ function ResultPanel({ result }: { result: AlphaBenchResult }) {
grid: { left: 8, right: 8, top: 32, bottom: 8, containLabel: true },
xAxis: {
type: "category",
- data: themes,
+ data: themes.map((t) => i18n.t("alphaZoo.themes." + t, { defaultValue: t })),
axisLine: { lineStyle: { color: theme.axisColor } },
axisLabel: { color: theme.textColor, fontSize: 10, rotate: themes.length > 6 ? 30 : 0 },
},
@@ -947,9 +961,9 @@ function ResultPanel({ result }: { result: AlphaBenchResult }) {
axisLabel: { color: theme.textColor, fontSize: 10 },
},
series: [
- { name: "Alive", type: "bar", stack: "n", data: aliveSeries, itemStyle: { color: theme.upColor } },
- { name: "Reversed", type: "bar", stack: "n", data: reversedSeries, itemStyle: { color: theme.warningColor } },
- { name: "Dead", type: "bar", stack: "n", data: deadSeries, itemStyle: { color: theme.downColor } },
+ { name: i18n.t("alphaZoo.alive"), type: "bar", stack: "n", data: aliveSeries, itemStyle: { color: theme.upColor } },
+ { name: i18n.t("alphaZoo.reversed"), type: "bar", stack: "n", data: reversedSeries, itemStyle: { color: theme.warningColor } },
+ { name: i18n.t("alphaZoo.dead"), type: "bar", stack: "n", data: deadSeries, itemStyle: { color: theme.downColor } },
],
});
@@ -962,10 +976,10 @@ function ResultPanel({ result }: { result: AlphaBenchResult }) {
}, [result, dark]);
const totals = [
- { label: "Alive", value: result.alive, icon: CheckCircle2, tone: "text-green-600 dark:text-green-400" },
- { label: "Reversed", value: result.reversed, icon: AlertTriangle, tone: "text-amber-600 dark:text-amber-400" },
- { label: "Dead", value: result.dead, icon: XCircle, tone: "text-red-600 dark:text-red-400" },
- { label: "Skipped", value: result.skipped ?? 0, icon: Loader2, tone: "text-muted-foreground" },
+ { label: i18n.t("alphaZoo.alive"), value: result.alive, icon: CheckCircle2, tone: "text-green-600 dark:text-green-400" },
+ { label: i18n.t("alphaZoo.reversed"), value: result.reversed, icon: AlertTriangle, tone: "text-amber-600 dark:text-amber-400" },
+ { label: i18n.t("alphaZoo.dead"), value: result.dead, icon: XCircle, tone: "text-red-600 dark:text-red-400" },
+ { label: i18n.t("alphaZoo.skipped"), value: result.skipped ?? 0, icon: Loader2, tone: "text-muted-foreground" },
];
return (
@@ -985,15 +999,15 @@ function ResultPanel({ result }: { result: AlphaBenchResult }) {
{/* Top tables */}
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
- <TopTable title="Top 5 by IR" rows={result.top5_by_ir || []} />
- <TopTable title="Most reversed" rows={(result.dead_examples || []).slice(0, 3)} />
+ <TopTable title={i18n.t("alphaZoo.topByIr")} rows={result.top5_by_ir || []} />
+ <TopTable title={i18n.t("alphaZoo.mostReversed")} rows={(result.dead_examples || []).slice(0, 3)} />
</div>
{/* By-theme breakdown */}
{result.by_theme && Object.keys(result.by_theme).length > 0 && (
<div className="border rounded-xl p-4 bg-card">
<h3 className="text-sm font-medium text-muted-foreground mb-2">
- By theme
+ {i18n.t("alphaZoo.byTheme")}
</h3>
<div ref={chartRef} style={{ height: 240 }} />
</div>
@@ -1010,17 +1024,17 @@ function TopTable({ title, rows }: { title: string; rows: AlphaBenchTopRow[] })
</div>
{rows.length === 0 ? (
<div className="px-4 py-6 text-xs text-muted-foreground text-center">
- No rows.
+ {i18n.t("alphaZoo.noRows")}
</div>
) : (
<table className="w-full text-sm">
<thead>
<tr className="border-b">
- <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">ID</th>
- <th className="text-right px-4 py-2 text-xs text-muted-foreground font-medium">Mean IC</th>
- <th className="text-right px-4 py-2 text-xs text-muted-foreground font-medium">IR</th>
- <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">Theme</th>
- <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">Category</th>
+ <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">{i18n.t("alphaZoo.id")}</th>
+ <th className="text-right px-4 py-2 text-xs text-muted-foreground font-medium">{i18n.t("alphaZoo.meanIc")}</th>
+ <th className="text-right px-4 py-2 text-xs text-muted-foreground font-medium">{i18n.t("alphaZoo.ir")}</th>
+ <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">{i18n.t("alphaZoo.theme")}</th>
+ <th className="text-left px-4 py-2 text-xs text-muted-foreground font-medium">{i18n.t("alphaZoo.category")}</th>
</tr>
</thead>
<tbody>
@@ -1036,7 +1050,9 @@ function TopTable({ title, rows }: { title: string; rows: AlphaBenchTopRow[] })
</td>
<td className="px-4 py-2 text-right font-mono tabular-nums text-xs">{fmtNum(r.ic_mean)}</td>
<td className="px-4 py-2 text-right font-mono tabular-nums text-xs">{fmtNum(r.ir)}</td>
- <td className="px-4 py-2 text-xs text-muted-foreground">{(r.theme || []).join(", ") || "—"}</td>
+ <td className="px-4 py-2 text-xs text-muted-foreground">
+ {(r.theme || []).map((t) => i18n.t("alphaZoo.themes." + t, { defaultValue: t })).join(", ") || "—"}
+ </td>
<td className="px-4 py-2 text-xs">
<CategoryBadge category={r.category} />
</td>
@@ -1061,9 +1077,15 @@ function CategoryBadge({ category }: { category: AlphaBenchTopRow["category"] })
: category === "reversed"
? "bg-amber-500/10 text-amber-700 dark:text-amber-300"
: "bg-red-500/10 text-red-700 dark:text-red-300";
+ const label =
+ category === "alive"
+ ? i18n.t("alphaZoo.alive")
+ : category === "reversed"
+ ? i18n.t("alphaZoo.reversed")
+ : i18n.t("alphaZoo.dead");
return (
<span className={cn("inline-block px-2 py-0.5 rounded-full text-[10px] font-medium", tone)}>
- {category}
+ {label}
</span>
);
}
@@ -1212,27 +1234,25 @@ function CompareView() {
to="/alpha-zoo"
className="text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1"
>
- <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> Back to Alpha Zoo
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.backToAlphaZoo")}
</Link>
<div className="space-y-1">
<div className="flex items-center gap-2 text-xs text-muted-foreground uppercase tracking-wide">
- <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> Head-to-head compare
+ <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.headToHeadCompare")}
</div>
<h1 className="text-2xl md:text-3xl font-bold tracking-tight">
- Compare alphas side by side
+ {i18n.t("alphaZoo.compareAlphas")}
</h1>
<p className="text-sm text-muted-foreground max-w-2xl">
- Benches just the alphas you pick on a universe and period, then ranks
- them by IC / IR with the gap to the leader — far faster than benching a
- whole zoo when you only care about a shortlist.
+ {i18n.t("alphaZoo.compareDesc")}
</p>
</div>
<form onSubmit={startCompare} className="border rounded-xl p-4 bg-card space-y-3">
<div>
<label htmlFor="compare-ids" className="text-xs text-muted-foreground block mb-1">
- Alpha ids{ids.length > 0 ? ` (${ids.length} selected)` : ""}
+ {i18n.t("alphaZoo.alphaIds")}{ids.length > 0 ? ` (${ids.length} ${i18n.t("alphaZoo.selected")})` : ""}
</label>
<textarea
id="compare-ids"
@@ -1244,14 +1264,13 @@ function CompareView() {
className="w-full px-3 py-2 rounded-lg border bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:opacity-50"
/>
<p className="text-[11px] text-muted-foreground mt-1">
- Separate ids with commas or spaces. Tip: tick alphas in the catalogue
- and hit “Compare” to prefill this.
+ {i18n.t("alphaZoo.alphaIdsHint")}
</p>
</div>
<div className="grid grid-cols-1 sm:grid-cols-3 gap-3">
<div>
- <label htmlFor="compare-universe" className="text-xs text-muted-foreground block mb-1">Universe</label>
+ <label htmlFor="compare-universe" className="text-xs text-muted-foreground block mb-1">{i18n.t("alphaZoo.universe")}</label>
<select
id="compare-universe"
value={universe}
@@ -1261,13 +1280,13 @@ function CompareView() {
>
{UNIVERSE_OPTIONS.map((u) => (
<option key={u.value} value={u.value}>
- {u.label}
+ {i18n.t("alphaZoo.universeOption." + u.value)}
</option>
))}
</select>
</div>
<div>
- <label htmlFor="compare-period" className="text-xs text-muted-foreground block mb-1">Period</label>
+ <label htmlFor="compare-period" className="text-xs text-muted-foreground block mb-1">{i18n.t("alphaZoo.period")}</label>
<input
id="compare-period"
value={period}
@@ -1288,7 +1307,7 @@ function CompareView() {
>
{SORT_OPTIONS.map((s) => (
<option key={s.value} value={s.value}>
- {s.label}
+ {i18n.t("alphaZoo.sortOption." + (s.value === "ic_mean" ? "icMean" : s.value === "ic_positive_ratio" ? "icPositiveRatio" : s.value === "ic_count" ? "icCount" : s.value))}
</option>
))}
</select>
@@ -1303,11 +1322,11 @@ function CompareView() {
>
{busy ? (
<>
- <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden="true" /> Running…
+ <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden="true" /> {i18n.t("alphaZoo.running")}
</>
) : (
<>
- <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> Compare
+ <ArrowLeftRight className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.compare")}
</>
)}
</button>
@@ -1338,33 +1357,38 @@ function CompareResultPanel({ result }: { result: AlphaCompareResult }) {
<div className="space-y-4">
<div className="flex flex-wrap items-center gap-x-4 gap-y-1 text-sm">
<span className="inline-flex items-center gap-1.5 font-medium text-emerald-600 dark:text-emerald-400">
- <CheckCircle2 className="h-4 w-4" aria-hidden="true" /> Winner:{" "}
+ <CheckCircle2 className="h-4 w-4" aria-hidden="true" /> {i18n.t("alphaZoo.winner")}:{" "}
<span className="font-mono">{result.winner}</span>
</span>
<span className="text-muted-foreground">
- {result.n_compared} compared · ranked by {result.sort} · {result.universe} · {result.period}
+ {i18n.t("alphaZoo.comparedRankedBy", {
+ count: result.n_compared,
+ sort: result.sort,
+ universe: result.universe,
+ period: result.period,
+ })}
</span>
{result.n_skipped > 0 && (
<span className="inline-flex items-center gap-1 text-amber-600 dark:text-amber-400">
- <AlertTriangle className="h-3.5 w-3.5" aria-hidden="true" /> {result.n_skipped} skipped
+ <AlertTriangle className="h-3.5 w-3.5" aria-hidden="true" /> {i18n.t("alphaZoo.skippedCount", { count: result.n_skipped })}
</span>
)}
</div>
<div className="border rounded-xl overflow-hidden">
<div className="overflow-x-auto">
- <table className="w-full text-sm" aria-label="Alpha comparison ranking">
+ <table className="w-full text-sm" aria-label={i18n.t("alphaZoo.alphaComparisonRanking")}>
<thead>
<tr className="border-b bg-muted/40 text-muted-foreground text-xs">
<th className="text-right px-3 py-2">#</th>
- <th className="text-left px-3 py-2">Alpha</th>
- <th className="text-left px-3 py-2 hidden sm:table-cell">Zoo</th>
- <th className="text-right px-3 py-2">IC mean</th>
- <th className="text-right px-3 py-2 hidden md:table-cell">IC std</th>
- <th className="text-right px-3 py-2">IR</th>
- <th className="text-right px-3 py-2 hidden md:table-cell" title="Share of periods with positive IC">IC&gt;0</th>
- <th className="text-right px-3 py-2 hidden lg:table-cell" title="IC sample count">n</th>
- <th className="text-right px-3 py-2" title={`Gap to the leader on ${result.sort}`}>Δ {result.sort}</th>
+ <th className="text-left px-3 py-2">{i18n.t("alphaZoo.alpha")}</th>
+ <th className="text-right px-3 py-2 hidden sm:table-cell">{i18n.t("alphaZoo.zoo")}</th>
+ <th className="text-right px-3 py-2">{i18n.t("alphaZoo.icMean")}</th>
+ <th className="text-right px-3 py-2 hidden md:table-cell">{i18n.t("alphaZoo.icStd")}</th>
+ <th className="text-right px-3 py-2">{i18n.t("alphaZoo.ir")}</th>
+ <th className="text-right px-3 py-2 hidden md:table-cell" title={i18n.t("alphaZoo.icPositiveTitle")}>{i18n.t("alphaZoo.icPositive")}</th>
+ <th className="text-right px-3 py-2 hidden lg:table-cell" title={i18n.t("alphaZoo.icSampleCount")}>{i18n.t("alphaZoo.sampleCount")}</th>
+ <th className="text-right px-3 py-2" title={i18n.t("alphaZoo.gapTitle", { sort: result.sort })}>Δ {result.sort}</th>
</tr>
</thead>
<tbody>
@@ -1403,7 +1427,7 @@ function CompareResultPanel({ result }: { result: AlphaCompareResult }) {
{result.skipped.length > 0 && (
<p className="text-xs text-muted-foreground">
- <span className="font-medium">Skipped:</span>{" "}
+ <span className="font-medium">{i18n.t("alphaZoo.skippedPre")}</span>{" "}
{result.skipped.map((s) => `${s.id} (${s.reason})`).join("; ")}
</p>
)}
diff --git a/frontend/src/pages/Correlation.tsx b/frontend/src/pages/Correlation.tsx
index cd43f87f1..aa3dc5124 100644
--- a/frontend/src/pages/Correlation.tsx
+++ b/frontend/src/pages/Correlation.tsx
@@ -6,7 +6,7 @@ import { CorrelationMatrix } from "@/components/charts/CorrelationMatrix";
const WINDOWS = [30, 60, 90, 180, 365] as const;
export function Correlation() {
- const [codes, setCodes] = useState("BTC-USDT,ETH-USDT,SPY,AAPL");
+ const [codes, setCodes] = useState("000001.SZ,600519.SH,000858.SZ,601318.SH");
const [days, setDays] = useState<number>(90);
const [method, setMethod] = useState<"pearson" | "spearman">("pearson");
const [loading, setLoading] = useState(false);
@@ -25,7 +25,7 @@ export function Correlation() {
setLabels(result.labels);
setMatrix(result.matrix);
} catch (e) {
- setError(e instanceof Error ? e.message : "Failed to compute correlation");
+ setError(e instanceof Error ? e.message : i18n.t("correlation.failedToCompute"));
} finally {
setLoading(false);
}
@@ -47,11 +47,11 @@ export function Correlation() {
type="text"
value={codes}
onChange={(e) => setCodes(e.target.value)}
- placeholder="BTC-USDT,ETH-USDT,SPY"
+ placeholder="000001.SZ,600519.SH,000858.SZ"
className="w-full px-3 py-2 rounded-md border bg-background text-sm"
/>
<p className="text-xs text-muted-foreground">
- Comma-separated ticker symbols, e.g. BTC-USDT,ETH-USDT,AAPL,SPY
+ {i18n.t("correlation.assetCodesHint")}
</p>
</div>
@@ -88,7 +88,7 @@ export function Correlation() {
: "border-muted-foreground/30 hover:border-primary"
}`}
>
- {m}
+ {i18n.t(`correlation.method_${m}`)}
</button>
))}
</div>
diff --git a/frontend/src/pages/RunDetail.tsx b/frontend/src/pages/RunDetail.tsx
index 2acee2f50..81b14cbc6 100644
--- a/frontend/src/pages/RunDetail.tsx
+++ b/frontend/src/pages/RunDetail.tsx
@@ -282,7 +282,7 @@ export function RunDetail() {
className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:bg-muted transition-colors"
title={i18n.t("runDetail.downloadTradesCsv")}
>
- <Download className="h-3.5 w-3.5" /> Download Trades CSV
+ <Download className="h-3.5 w-3.5" /> {i18n.t("runDetail.downloadTradesCsv")}
</button>
)}
{run.metrics && (
@@ -291,7 +291,7 @@ export function RunDetail() {
className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs text-muted-foreground hover:bg-muted transition-colors"
title={i18n.t("runDetail.downloadMetricsCsv")}
>
- <Download className="h-3.5 w-3.5" /> Download Metrics CSV
+ <Download className="h-3.5 w-3.5" /> {i18n.t("runDetail.downloadMetricsCsv")}
</button>
)}
</div>
@@ -348,7 +348,7 @@ function RunCardTab({ card }: { card: RunCard }) {
<section className="rounded-md border border-amber-500/25 bg-amber-500/5 p-3">
<div className="mb-2 flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300">
<AlertTriangle className="h-4 w-4" />
- Warnings
+ {i18n.t("runDetail.warnings")}
</div>
<ul className="space-y-1 text-xs text-muted-foreground">
{warnings.map((warning, index) => <li key={index}>{warning}</li>)}