I18n: tlumaczenie nazw slownikowych w panelu admina (pole 'Nazwa (EN)' w katalogach cwiczen/sprzetu/stref + podglad nazwy EN i render wg jezyka, lista/postepy/historia/lancuch priorytetow)

This commit is contained in:
tisachi
2026-10-17 10:46:50 +02:00
parent d907456079
commit 81a7b0202e
11 changed files with 161 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ChevronDown, ChevronUp, TrendingDown, TrendingUp } from 'lucide-react';
import {
Bar,
@@ -13,6 +14,7 @@ import {
} from 'recharts';
import type { ExerciseProgress } from '../api/types';
import { fmtDate, fmtVolume } from '../lib/format';
import { localizedName } from '../lib/localizedName';
import { MUSCLE_NAMES } from '../lib/labels';
import { Badge, Tabs } from './ui';
@@ -30,6 +32,7 @@ const TOOLTIP_STYLE = {
* Współdzielone z detalem podopiecznego (spójnie).
*/
export default function ExerciseProgressCards({ exercises }: { exercises: ExerciseProgress[] }) {
const { i18n } = useTranslation();
const [openId, setOpenId] = useState<string | null>(null);
// aktywna zakładka per ćwiczenie (domyślnie 1RM)
const [tabs, setTabs] = useState<Record<string, 'onerm' | 'volume'>>({});
@@ -64,7 +67,9 @@ export default function ExerciseProgressCards({ exercises }: { exercises: Exerci
<div className="flex items-center justify-between gap-3">
<div className="min-w-0">
<div className="flex items-center gap-2">
<strong className="truncate text-[0.95rem]">{ex.name}</strong>
<strong className="truncate text-[0.95rem]">
{localizedName(ex, i18n.language)}
</strong>
{isPr && <Badge color="green">PR</Badge>}
</div>
<div className="text-[0.8125rem] text-dim">

View File

@@ -1,7 +1,9 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ChevronDown, ChevronUp, MessageSquare } from 'lucide-react';
import type { HistorySession } from '../api/types';
import { fmtDate, fmtDuration, fmtVolume } from '../lib/format';
import { localizedName } from '../lib/localizedName';
import { MUSCLE_NAMES, SESSION_STATUS } from '../lib/labels';
import { Badge } from './ui';
@@ -16,6 +18,7 @@ interface HistoryTableProps {
* Port odpowiednika z aplikacji (`app/src/components/HistoryTable`) bez dodawania komentarzy.
*/
export default function HistoryTable({ sessions, initialOpenSessionId }: HistoryTableProps) {
const { i18n } = useTranslation();
const [openSession, setOpenSession] = useState<string | null>(initialOpenSessionId ?? null);
return (
@@ -103,7 +106,9 @@ export default function HistoryTable({ sessions, initialOpenSessionId }: History
<div key={ex.id} className="py-3">
<div className="mb-2 flex items-center justify-between gap-3">
<div className="flex min-w-0 items-center gap-2">
<strong className="text-[0.95rem]">{ex.name}</strong>
<strong className="text-[0.95rem]">
{localizedName(ex, i18n.language)}
</strong>
{ex.isExtra && <Badge color="yellow">dodane</Badge>}
</div>
<span className="text-dim text-[0.875rem]">