Implement internationalization support by adding translation functionality and updating UI components to use translated strings. Add language configuration in .env.example and integrate translations across various strategy and UI components.

This commit is contained in:
discountry
2025-12-09 00:35:28 +08:00
parent 03df1006cc
commit 85e7f245c0
17 changed files with 1166 additions and 295 deletions
+10 -4
View File
@@ -1,8 +1,14 @@
import { t } from "../i18n";
export type TrendLabel = "做多" | "做空" | "无信号";
export function formatTrendLabel(trend: TrendLabel): string {
if (trend === "做多") return t("trend.label.long");
if (trend === "做空") return t("trend.label.short");
return t("trend.label.none");
}
export function formatNumber(value: number | null | undefined, digits = 4, fallback = "-"): string {
if (value == null || Number.isNaN(value)) return fallback;
return Number(value).toFixed(digits);
}
export function formatTrendLabel(trend: "做多" | "做空" | "无信号"): string {
return trend;
}