Adds client-side i18n support, language settings, translated UI copy, and locale parity coverage.
24 lines
687 B
TypeScript
24 lines
687 B
TypeScript
import { i18n } from "@/i18n/i18next";
|
|
|
|
export interface CompactionMarkerLabelInput {
|
|
status: "loading" | "completed";
|
|
trigger?: "auto" | "manual";
|
|
preTokens?: number;
|
|
}
|
|
|
|
export function getCompactionMarkerLabel({
|
|
status,
|
|
trigger,
|
|
preTokens,
|
|
}: CompactionMarkerLabelInput): string {
|
|
if (status === "loading") return i18n.t("message.compaction.loading");
|
|
if (trigger === "auto") return i18n.t("message.compaction.auto");
|
|
if (trigger === "manual") return i18n.t("message.compaction.manual");
|
|
if (preTokens) {
|
|
return i18n.t("message.compaction.withTokens", {
|
|
tokens: Math.round(preTokens / 1000),
|
|
});
|
|
}
|
|
return i18n.t("message.compaction.completed");
|
|
}
|