refactor(i18n,format): translate ETA strings; consolidate time/duration formatters
- formatEta was hardcoded English (violated the trilingual rule) -> time.eta.* keys in EN/HU/DE; Scheduler's countdown 'now' likewise. - relativeFromMs added to format.ts; NotificationsPanel drops its duplicate relativeTime/relativeFromMs and the now-orphaned notifications.time.* keys. - Channels' fmtTotalDuration moved to format.ts as formatTotalHours.
This commit is contained in:
parent
5768c1a5cb
commit
9eaec27c7c
10 changed files with 61 additions and 64 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import i18n from "../i18n";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import {
|
||||
Activity,
|
||||
|
|
@ -31,7 +32,7 @@ function secsUntil(iso: string | null): number | null {
|
|||
}
|
||||
|
||||
function fmtCountdown(s: number): string {
|
||||
if (s <= 0) return "now";
|
||||
if (s <= 0) return i18n.t("time.eta.now");
|
||||
if (s < 60) return `${s}s`;
|
||||
const m = Math.floor(s / 60);
|
||||
if (m < 60) return `${m}m ${s % 60}s`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue