mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
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:
+10
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user