From ec16e4913a9eefb64fd2002e576b597e805b4b6b Mon Sep 17 00:00:00 2001 From: tisachi Date: Sat, 17 Oct 2026 15:20:18 +0200 Subject: [PATCH] =?UTF-8?q?I18n:=20profil,=20podopieczni,=20dashboard=20i?= =?UTF-8?q?=20kalendarz=20(partia=205)=20-=20podstrony=20profilu=20(Profil?= =?UTF-8?q?e,=20ProfileInfo,=20ProfileBodyParameters,=20ProfileClaims,=20P?= =?UTF-8?q?rofileHistory,=20ProfileProgress;=20namespace=20profile),=20lis?= =?UTF-8?q?ta=20i=20detal=20podopiecznego=20+=20zakladki=20(Przeglad/Rozmo?= =?UTF-8?q?wa/Dyscyplina/Postepy/Kalendarz/Plany;=20rozbudowany=20namespac?= =?UTF-8?q?e=20trainees),=20Dashboard=20(powitania,=20statystyki,=20feed;?= =?UTF-8?q?=20dashboard.json),=20Calendar=20+=20App=20(ladowanie);=20wsp?= =?UTF-8?q?=C3=B3lne:=20AddressFields=20sformalizowany=20(gyms:address=20s?= =?UTF-8?q?ownika=20+=20kraje),=20AvailabilityEditor=20aria,=20ExercisePro?= =?UTF-8?q?gressCards=20(common:progress),=20HistoryTable=20(common:histor?= =?UTF-8?q?y),=20usuniete=20ostanie=20literaly=20PL=20i=20'pl-PL'=20w=20to?= =?UTF-8?q?LocaleString=20(locale=20wg=20jezyka)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/App.tsx | 6 +- app/src/components/AddressFields.tsx | 38 +-- app/src/components/AvailabilityEditor.tsx | 8 +- app/src/components/ExerciseProgressCards.tsx | 31 +- app/src/components/HistoryTable.tsx | 29 +- app/src/components/Layout.tsx | 5 +- app/src/components/ui/dialogs.tsx | 3 +- app/src/i18n/locales/en/common.json | 29 ++ app/src/i18n/locales/en/dashboard.json | 40 ++- app/src/i18n/locales/en/gyms.json | 17 ++ app/src/i18n/locales/en/plans.json | 8 +- app/src/i18n/locales/en/profile.json | 110 ++++++- app/src/i18n/locales/en/trainees.json | 74 ++++- app/src/i18n/locales/pl/common.json | 33 +++ app/src/i18n/locales/pl/dashboard.json | 40 ++- app/src/i18n/locales/pl/gyms.json | 17 ++ app/src/i18n/locales/pl/plans.json | 8 +- app/src/i18n/locales/pl/profile.json | 110 ++++++- app/src/i18n/locales/pl/trainees.json | 74 ++++- app/src/pages/Calendar.tsx | 16 +- app/src/pages/Dashboard.tsx | 110 ++++--- app/src/pages/gyms/GymDetail.tsx | 2 +- app/src/pages/profile/Profile.tsx | 56 ++-- .../pages/profile/ProfileBodyParameters.tsx | 101 ++++--- app/src/pages/profile/ProfileClaims.tsx | 57 ++-- app/src/pages/profile/ProfileHistory.tsx | 25 +- app/src/pages/profile/ProfileInfo.tsx | 155 +++++----- app/src/pages/profile/ProfileProgress.tsx | 29 +- app/src/pages/trainees/TraineeDetail.tsx | 52 ++-- app/src/pages/trainees/Trainees.tsx | 86 +++--- .../trainee-detail/ConversationCard.tsx | 12 +- .../trainees/trainee-detail/DisciplineTab.tsx | 29 +- .../trainees/trainee-detail/OverviewTab.tsx | 39 ++- .../trainees/trainee-detail/ProgressTab.tsx | 39 ++- .../trainee-detail/TraineeCalendarTab.tsx | 16 +- .../trainee-detail/TraineePlansTab.tsx | 89 +++--- app/src/store/theme.ts | 2 +- app/src/topbar/Topbar.tsx | 273 +++++++++--------- 38 files changed, 1279 insertions(+), 589 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index f481a20..0125f8b 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -1,4 +1,5 @@ import { useEffect, type ReactNode } from 'react'; +import { useTranslation } from 'react-i18next'; import { Routes, Route, Navigate } from 'react-router-dom'; import { useAuth } from './store/auth'; import { useMe } from './api/queries'; @@ -39,6 +40,7 @@ function TrainerOnly({ children }: { children: ReactNode }) { } export default function App() { + const { t } = useTranslation(); const { user, ready, init } = useAuth(); useEffect(() => { @@ -46,7 +48,9 @@ export default function App() { }, [init]); if (!ready) { - return
Ładowanie…
; + return ( +
{t('loading')}
+ ); } return ( diff --git a/app/src/components/AddressFields.tsx b/app/src/components/AddressFields.tsx index 1f46717..c32bee5 100644 --- a/app/src/components/AddressFields.tsx +++ b/app/src/components/AddressFields.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from 'react-i18next'; import { Field, Input, Select } from './ui'; /** @@ -5,13 +6,13 @@ import { Field, Input, Select } from './ui'; * kod pocztowy, miejscowość, kraj). Display string `location` składa serwer. */ -export const COUNTRIES: { code: string; label: string }[] = [ - { code: 'PL', label: 'Polska' }, - { code: 'DE', label: 'Niemcy' }, - { code: 'CZ', label: 'Czechy' }, - { code: 'SK', label: 'Słowacja' }, - { code: 'LT', label: 'Litwa' }, - { code: 'GB', label: 'Wielka Brytania' }, +export const COUNTRIES: { code: string; labelKey: string }[] = [ + { code: 'PL', labelKey: 'PL' }, + { code: 'DE', labelKey: 'DE' }, + { code: 'CZ', labelKey: 'CZ' }, + { code: 'SK', labelKey: 'SK' }, + { code: 'LT', labelKey: 'LT' }, + { code: 'GB', labelKey: 'GB' }, ]; /** Polskie kody pocztowe: 00-001. */ @@ -58,25 +59,26 @@ export function AddressFields({ onChange: (patch: Partial) => void; required?: boolean; }) { + const { t } = useTranslation('gyms'); const postalInvalid = values.postalCode.length > 0 && !PL_POSTAL_CODE.test(values.postalCode); return ( <> - + onChange({ addressLine1: e.target.value })} - placeholder="np. Mokotowska 12A" + placeholder={t('address.streetPh')} required={required} /> - + onChange({ addressLine2: e.target.value })} - placeholder="np. piętro 2, lokal 5" + placeholder={t('address.premisesPh')} /> - + onChange({ postalCode: formatPostalCodeInput(e.target.value) })} @@ -86,25 +88,27 @@ export function AddressFields({ aria-invalid={postalInvalid || undefined} required={required} /> - {postalInvalid &&

Format kodu: 00-001

} + {postalInvalid && ( +

{t('address.postalFormatError')}

+ )}
- + onChange({ city: e.target.value })} - placeholder="np. Warszawa" + placeholder={t('address.cityPh')} autoComplete="address-level2" required={required} /> - + diff --git a/app/src/components/AvailabilityEditor.tsx b/app/src/components/AvailabilityEditor.tsx index 38b5612..f86a843 100644 --- a/app/src/components/AvailabilityEditor.tsx +++ b/app/src/components/AvailabilityEditor.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from 'react-i18next'; import { TIME_SLOTS, dayFull } from '../lib/availability'; import { Select } from './ui'; import type { Availability, DayAvailability } from '../api/types'; @@ -12,6 +13,7 @@ export function AvailabilityEditor({ value: Availability; onChange: (value: Availability) => void; }) { + const { t } = useTranslation(); const setDay = (i: number, day: DayAvailability | null) => { const next = [...value]; next[i] = day; @@ -31,13 +33,13 @@ export function AvailabilityEditor({ {name} setDay(i, e.target.checked ? { start, end } : null)} className="size-4 accent-[var(--accent)]" /> –