-
- Zdjęcia siłowni. Pierwsze zdjęcie (najmniejsza kolejność) jest okładką.
-
+
{t('gallery.hint')}
{canManage && (
)}
{canManage && (
@@ -127,7 +127,7 @@ export default function GymGallery({
type="file"
multiple
accept={ALLOWED_MIME.join(',')}
- aria-label="Dodaj zdjęcia"
+ aria-label={t('gallery.addAria')}
className="hidden"
onChange={(e) => onFilesChange(e.target.files)}
/>
@@ -136,7 +136,7 @@ export default function GymGallery({
{fileError &&
{fileError}}
{photos.length === 0 ? (
-
Brak zdjęć.
+
{t('gallery.empty')}
) : (
{photos.map((p) => {
@@ -151,7 +151,7 @@ export default function GymGallery({
- Okładka
+ {t('gallery.coverBadge')}
)}
@@ -160,8 +160,8 @@ export default function GymGallery({
{!isCover && (
diff --git a/app/src/components/gyms/InviteGymModal.tsx b/app/src/components/gyms/InviteGymModal.tsx
index a9acbc9..b52b5fb 100644
--- a/app/src/components/gyms/InviteGymModal.tsx
+++ b/app/src/components/gyms/InviteGymModal.tsx
@@ -1,4 +1,5 @@
import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useQueryClient } from '@tanstack/react-query';
import { sendGymInvitation, useGymInviteeSearch } from '../../api/queries';
import { Button, ErrorText, Field, Input, Loading, Modal } from '../ui';
@@ -16,6 +17,7 @@ export default function InviteGymModal({
}) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('gyms');
const [firstName, setFirstName] = useState('');
const [lastName, setLastName] = useState('');
const [busyId, setBusyId] = useState
(null);
@@ -31,7 +33,7 @@ export default function InviteGymModal({
queryClient.invalidateQueries({ queryKey: ['gym-invitations'] }),
queryClient.invalidateQueries({ queryKey: ['gyms', 'virtual'] }),
]);
- push(`Zaproszono: ${name}`, 'success');
+ push(t('invite.toastOk', { name }), 'success');
} catch (e) {
push((e as Error).message, 'error');
} finally {
@@ -40,28 +42,33 @@ export default function InviteGymModal({
};
return (
-
+
-
+
setFirstName(e.target.value)}
- placeholder="np. Jan"
+ placeholder={t('invite.firstNamePh')}
/>
-
+
setLastName(e.target.value)}
- placeholder="np. Kowalski"
+ placeholder={t('invite.lastNamePh')}
/>
{searching && isLoading && }
- {searching && error && Błąd: {(error as Error).message}}
+ {searching && error && (
+
+ {t('common:errorPrefix')}
+ {(error as Error).message}
+
+ )}
{searching && !isLoading && !error && (data?.users ?? []).length === 0 && (
- Brak użytkowników o podanych danych.
+ {t('invite.empty')}
)}
{(data?.users ?? []).map((u) => {
@@ -81,7 +88,7 @@ export default function InviteGymModal({
disabled={busyId === u.id}
onClick={() => void invite(u.id, name)}
>
- {busyId === u.id ? 'Zapraszanie…' : 'Zaproś'}
+ {busyId === u.id ? t('invite.busy') : t('invite.submit')}
);
diff --git a/app/src/components/gyms/JoinGymModal.tsx b/app/src/components/gyms/JoinGymModal.tsx
index 3ee0a61..11002ce 100644
--- a/app/src/components/gyms/JoinGymModal.tsx
+++ b/app/src/components/gyms/JoinGymModal.tsx
@@ -1,4 +1,5 @@
import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useQueryClient } from '@tanstack/react-query';
import { joinGym, useAllGyms, useGyms } from '../../api/queries';
import type { Gym } from '../../api/types';
@@ -12,6 +13,7 @@ import { useToast } from '../toast';
export default function JoinGymModal({ open, onClose }: { open: boolean; onClose: () => void }) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('gyms');
const [query, setQuery] = useState('');
const [busyId, setBusyId] = useState(null);
@@ -33,7 +35,7 @@ export default function JoinGymModal({ open, onClose }: { open: boolean; onClose
queryClient.invalidateQueries({ queryKey: ['gyms'] }),
queryClient.invalidateQueries({ queryKey: ['gyms', 'all'] }),
]);
- push(`Dołączono do siłowni: ${g.name}`, 'success');
+ push(t('join.toastOk', { name: g.name }), 'success');
} catch (e) {
push((e as Error).message, 'error');
} finally {
@@ -42,23 +44,26 @@ export default function JoinGymModal({ open, onClose }: { open: boolean; onClose
};
return (
-
+
setQuery(e.target.value)}
/>
{isLoading &&
}
- {error &&
Błąd: {(error as Error).message}}
+ {error && (
+
+ {t('common:errorPrefix')}
+ {(error as Error).message}
+
+ )}
{!isLoading && !error && filtered.length === 0 && (
- {q
- ? 'Brak wyników dla podanego zapytania.'
- : 'Brak siłowni do dołączenia — należysz już do wszystkich.'}
+ {q ? t('join.emptyQuery') : t('join.emptyAll')}
)}
{filtered.map((g) => (
@@ -69,7 +74,7 @@ export default function JoinGymModal({ open, onClose }: { open: boolean; onClose
{g.name}
- {g.location || '—'} · {g.equipment.length} urządzeń
+ {g.location || '—'} · {t('common:counters.devices', { count: g.equipment.length })}
void join(g)}
>
- {busyId === g.id ? 'Dołączanie…' : 'Dołącz'}
+ {busyId === g.id ? t('join.busy') : t('join.submit')}
))}
diff --git a/app/src/i18n/index.ts b/app/src/i18n/index.ts
index 4bd6944..f0da552 100644
--- a/app/src/i18n/index.ts
+++ b/app/src/i18n/index.ts
@@ -15,6 +15,7 @@ import plPlans from './locales/pl/plans.json';
import plDashboard from './locales/pl/dashboard.json';
import plGyms from './locales/pl/gyms.json';
import plMessages from './locales/pl/messages.json';
+import plInvitations from './locales/pl/invitations.json';
import plFeed from './locales/pl/feed.json';
import plProfile from './locales/pl/profile.json';
import plTrainees from './locales/pl/trainees.json';
@@ -27,6 +28,7 @@ import enPlans from './locales/en/plans.json';
import enDashboard from './locales/en/dashboard.json';
import enGyms from './locales/en/gyms.json';
import enMessages from './locales/en/messages.json';
+import enInvitations from './locales/en/invitations.json';
import enFeed from './locales/en/feed.json';
import enProfile from './locales/en/profile.json';
import enTrainees from './locales/en/trainees.json';
@@ -41,6 +43,7 @@ export const NAMESPACES = [
'dashboard',
'gyms',
'messages',
+ 'invitations',
'feed',
'profile',
'trainees',
@@ -58,6 +61,7 @@ const resources = {
dashboard: plDashboard,
gyms: plGyms,
messages: plMessages,
+ invitations: plInvitations,
feed: plFeed,
profile: plProfile,
trainees: plTrainees,
@@ -72,6 +76,7 @@ const resources = {
dashboard: enDashboard,
gyms: enGyms,
messages: enMessages,
+ invitations: enInvitations,
feed: enFeed,
profile: enProfile,
trainees: enTrainees,
diff --git a/app/src/i18n/locales/en/common.json b/app/src/i18n/locales/en/common.json
index 8abfa54..dd8c7f7 100644
--- a/app/src/i18n/locales/en/common.json
+++ b/app/src/i18n/locales/en/common.json
@@ -1,8 +1,11 @@
{
"appName": "FitOS",
+ "errorPrefix": "Error: ",
"cancel": "Cancel",
"confirm": "Confirm",
"save": "Save",
+ "saving": "Saving…",
+ "edit": "Edit",
"close": "Close",
"closeNotification": "Close notification",
"clear": "Clear",
@@ -16,6 +19,8 @@
"toggleLanguage": "Change language",
"ok": "OK",
"remove": "Remove",
+ "yes": "yes",
+ "no": "no",
"loading": "Loading…",
"back": "Back",
"searchShort": "Search…",
@@ -81,7 +86,9 @@
"weeks_other": "{{count}} weeks",
"setCount_one": "{{count}} set",
"setCount_other": "{{count}} sets",
- "weeksShort": "{{count}} wk"
+ "weeksShort": "{{count}} wk",
+ "devices_one": "{{count}} device",
+ "devices_other": "{{count}} devices"
},
"muscles": {
"chest": "Chest",
diff --git a/app/src/i18n/locales/en/feed.json b/app/src/i18n/locales/en/feed.json
index 0967ef4..d9c0163 100644
--- a/app/src/i18n/locales/en/feed.json
+++ b/app/src/i18n/locales/en/feed.json
@@ -1 +1,16 @@
-{}
+{
+ "markAll": "Mark all read",
+ "markAllToast": "Everything marked as read",
+ "emptyTitle": "No news",
+ "emptyDesc": "Plans from your trainer and gym announcements will appear here.",
+ "loadOlder": "Load older",
+ "loading": "Loading…",
+ "itemType": {
+ "planFromTrainer": "Plan from trainer",
+ "sharedPlan": "Shared plan",
+ "gymDeleted": "Deleted gym",
+ "announcement": "Announcement",
+ "hoursChange": "Hours change",
+ "exception": "Schedule exception"
+ }
+}
diff --git a/app/src/i18n/locales/en/gyms.json b/app/src/i18n/locales/en/gyms.json
index 0967ef4..c5a5360 100644
--- a/app/src/i18n/locales/en/gyms.json
+++ b/app/src/i18n/locales/en/gyms.json
@@ -1 +1,240 @@
-{}
+{
+ "upload": {
+ "maxFiles": "Maximum {{count}} files",
+ "badType": "Unsupported file type: {{name}} (allowed: {{types}})",
+ "tooBig": "File {{name}} is larger than 5 MB"
+ },
+ "spec": {
+ "upToKg": "up to {{v}} kg",
+ "fromKg": "from {{v}} kg",
+ "upToKmh": "up to {{v}} km/h",
+ "inclineUpTo": "incline up to {{v}}%",
+ "minKg": "Min. load (kg)",
+ "maxKg": "Max. load (kg)",
+ "maxLoadKg": "Maximum load (kg)",
+ "maxSpeed": "Max. speed (km/h)",
+ "maxIncline": "Max. incline (%)"
+ },
+ "sections": {
+ "savedToast": "Changes saved",
+ "nameLabel": "Name",
+ "locationLabel": "Location",
+ "capacityLabel": "Capacity (people)",
+ "privateEdit": "Private (hidden from others — accessible only by invitation)"
+ },
+ "photo": {
+ "addBtn": "Add photos",
+ "formatsHint": "JPG, PNG or WebP · max 5 MB",
+ "maxToast": "Maximum {{count}} photos per device",
+ "formatsToast": "Allowed formats: JPG, PNG, WebP",
+ "sizeToast": "Maximum photo size is 5 MB",
+ "removeFileAria": "Remove {{name}}"
+ },
+ "equipment": {
+ "inStock": "In stock ({{count}})",
+ "empty": "No equipment — add the first item from the catalog below.",
+ "qtyAria": "Quantity: {{name}}",
+ "editAria": "Edit {{name}}",
+ "removeAria": "Remove {{name}}",
+ "editTitle": "Editing: {{name}}",
+ "closeEditAria": "Close editor",
+ "itemParams": "Item parameters",
+ "photosCount": "Photos ({{n}}/{{max}})",
+ "addPhotosLabel": "Add device photos",
+ "restoreCatalog": "Restore catalog spec",
+ "restoreToast": "Catalog spec restored",
+ "addTitle": "Add device from catalog",
+ "addAria": "Add device",
+ "chooseDevice": "Choose device…",
+ "onStock": " (in stock: {{count}})",
+ "qtyLabel": "Quantity",
+ "addBtn": "Add",
+ "adding": "Adding…",
+ "paramsLabel": "Parameters",
+ "addPhotosSwitch": "Add photos to this item (optional)",
+ "photosLabel": "Device photos",
+ "specRangeError": "Provide the load range (min and max in kg).",
+ "specMaxLoadError": "Provide the maximum load (kg).",
+ "specCardioError": "Provide device parameters (speed or incline).",
+ "specEditError": "Provide parameters or restore the catalog spec.",
+ "addedPartialToast": "Device added, but photos upload failed",
+ "addedToast": "Equipment added",
+ "photosFailToast": "Failed to upload photos",
+ "removedToast": "Removed: {{name}}"
+ },
+ "hours": {
+ "closed": "closed"
+ },
+ "detail": {
+ "back": "Back",
+ "notFound": "Gym not found.",
+ "photoMore": "+{{count}} more",
+ "noEquipment": "No equipment.",
+ "photosAria": "Photos: {{name}}",
+ "places": "{{count}} places",
+ "chipVirtual": "Virtual",
+ "chipPrivate": "Private",
+ "galleryTitle": "Photo gallery",
+ "equipmentTitle": "Equipment",
+ "equipmentDesc": "Machines and devices available at this gym.",
+ "hoursTitle": "Opening hours",
+ "exceptionsLabel": "Exceptions",
+ "dataTitle": "Details",
+ "dataKind": "Type",
+ "dataPrivate": "Private",
+ "dataCapacity": "Capacity",
+ "dataStreet": "Street",
+ "dataPostalCity": "Postal code and city",
+ "dataCountry": "Country",
+ "dataLocation": "Location",
+ "groupEdit": "Editing",
+ "groupGallery": "Gallery",
+ "groupEquipment": "Equipment",
+ "groupAnnouncements": "Announcements",
+ "groupInvites": "Invitations",
+ "actionInfo": "Information",
+ "actionInvite": "Invite user",
+ "actionWithdrawClaim": "Withdraw request",
+ "actionClaimVerify": "Submit verification request",
+ "actionDelete": "Delete gym",
+ "claimWithdrawnToast": "Request withdrawn",
+ "modalInfo": "Information",
+ "modalGallery": "Manage gallery",
+ "modalEquipment": "Manage equipment",
+ "modalAnnouncements": "Announcements",
+ "exceptionsTitle": "Schedule exceptions",
+ "exceptionsDesc": "One-off changes for a specific day (closure or different hours).",
+ "deleteDesc": "Delete the gym? Memberships will be removed, users' plans will be kept."
+ },
+ "exceptions": {
+ "removedToast": "Exception removed",
+ "empty": "No exceptions.",
+ "addedToast": "Exception added",
+ "addTitle": "Add exception — date and day mode",
+ "dateAria": "Exception date",
+ "closedMode": "Closed",
+ "hoursMode": "Other hours",
+ "fromAria": "From time",
+ "toAria": "To time"
+ },
+ "announcements": {
+ "toastPublished": "Announcement published",
+ "toastRemoved": "Announcement removed",
+ "composerTitle": "New announcement — it will reach all gym members",
+ "titlePh": "Title (e.g. Air conditioning failure)",
+ "titleAria": "Announcement title",
+ "bodyPh": "Announcement body…",
+ "bodyAria": "Announcement body",
+ "publish": "Publish",
+ "publishing": "Publishing…",
+ "empty": "No announcements.",
+ "systemBadge": "System"
+ },
+ "invites": {
+ "desc": "A private gym is hidden — invite specific users.",
+ "empty": "No invitations sent.",
+ "withdraw": "Withdraw",
+ "toastWithdrawn": "Invitation withdrawn"
+ },
+ "page": {
+ "open": "Open →",
+ "members": "{{count}} members",
+ "ratingTitle": "Percentage of “recommend” votes",
+ "voteTitle": "Does this virtual gym reflect the real one well?",
+ "voteUpAria": "Recommend: {{name}}",
+ "voteDownAria": "Do not recommend: {{name}}",
+ "claimPending": "Request is pending verification",
+ "rejected": "Rejected",
+ "resubmit": "Submit again",
+ "sentInvites": "Sent invitations",
+ "tabMine": "My gyms",
+ "tabVirtual": "Virtual",
+ "virtualHeading": "Virtual gyms",
+ "emptyQueryTitle": "No results",
+ "emptyMineTitle": "No gyms",
+ "emptyMineDesc": "You are not a member of any gym. Create the first one or join an existing one.",
+ "emptyVirtualTitle": "No virtual gyms",
+ "emptyVirtualDesc": "Check back here to rate how well real gyms are reflected."
+ },
+ "claim": {
+ "toastOk": "Request submitted",
+ "titleVerify": "Verification request: {{name}}",
+ "titleNew": "New gym request",
+ "gymNameLabel": "Gym name",
+ "gymNamePh": "e.g. Iron Temple",
+ "locationLabel": "Location",
+ "locationPh": "e.g. 5 Długa St, Warsaw",
+ "availabilityLabel": "Availability",
+ "capacityLabel": "Capacity (people)",
+ "capacityPh": "e.g. 50",
+ "descLabel": "Description (why this gym deserves verification / creation)",
+ "descPh": "Short description",
+ "addressLabel": "Full gym address (optional — overrides location)",
+ "addressPh": "e.g. 5 Długa St, 00-050 Warsaw",
+ "companyLabel": "Company name",
+ "companyPh": "e.g. Fit Sp. z o.o.",
+ "nipLabel": "Tax ID (10 digits)",
+ "nipPh": "e.g. 1234567890",
+ "phoneLabel": "Phone",
+ "phonePh": "e.g. +48 600 000 000",
+ "emailLabel": "E-mail",
+ "emailPh": "e.g. contact@fitos.pl",
+ "docsLabel": "Documents (optional, up to {{count}} JPG/PNG/PDF files, max 5 MB each)",
+ "docsAria": "Documents",
+ "removeFileAria": "Remove {{name}}",
+ "submit": "Submit request",
+ "sending": "Sending…"
+ },
+ "create": {
+ "toastOk": "Gym created",
+ "title": "Create gym",
+ "nameLabel": "Name",
+ "namePh": "e.g. Iron Temple",
+ "kindLabel": "Type",
+ "kindVirtual": "Virtual",
+ "kindReal": "Real",
+ "privateCheck": "Private (hidden from others)",
+ "locationLabel": "Location",
+ "locationPh": "e.g. Warsaw",
+ "availabilityLabel": "Availability",
+ "capacityLabel": "Capacity (people)",
+ "capacityPh": "e.g. 50",
+ "submit": "Create",
+ "busy": "Creating…"
+ },
+ "gallery": {
+ "toastAdded": "Photos added",
+ "toastRemoved": "Photo removed",
+ "toastCover": "Cover set",
+ "hint": "Gym photos. The first photo (lowest order) is the cover.",
+ "addBtn": "Add photos",
+ "addAria": "Add photos",
+ "empty": "No photos.",
+ "coverBadge": "Cover",
+ "setCoverAria": "Set as cover",
+ "removeAria": "Remove photo",
+ "confirmTitle": "Remove photo",
+ "confirmText": "Are you sure you want to remove this photo?"
+ },
+ "invite": {
+ "toastOk": "Invited: {{name}}",
+ "title": "Invite user: {{name}}",
+ "firstNameLabel": "First name",
+ "firstNamePh": "e.g. John",
+ "lastNameLabel": "Last name",
+ "lastNamePh": "e.g. Smith",
+ "empty": "No users with these details.",
+ "submit": "Invite",
+ "busy": "Inviting…"
+ },
+ "join": {
+ "toastOk": "Joined gym: {{name}}",
+ "title": "Join gym",
+ "searchPh": "Search gyms…",
+ "searchAria": "Search gyms to join",
+ "emptyQuery": "No results for the given query.",
+ "emptyAll": "No gyms to join — you are already a member of all of them.",
+ "submit": "Join",
+ "busy": "Joining…"
+ }
+}
diff --git a/app/src/i18n/locales/en/invitations.json b/app/src/i18n/locales/en/invitations.json
new file mode 100644
index 0000000..c032257
--- /dev/null
+++ b/app/src/i18n/locales/en/invitations.json
@@ -0,0 +1,24 @@
+{
+ "expiryOverdue": "expired",
+ "expiryToday": "expires today",
+ "expiryTomorrow": "expires tomorrow",
+ "expiryInDays_one": "expires in {{count}} day",
+ "expiryInDays_other": "expires in {{count}} days",
+ "received": "Received",
+ "sent": "Sent",
+ "decline": "Decline",
+ "accept": "Accept",
+ "withdraw": "Withdraw",
+ "toastAccepted": "Invitation accepted",
+ "toastDeclined": "Invitation declined",
+ "toastWithdrawn": "Invitation withdrawn",
+ "badgeGym": "Gym",
+ "invitedBy": "invited by: {{name}}",
+ "toPerson": "to: {{name}}",
+ "scopeIn": "Incoming",
+ "scopeOut": "Outgoing",
+ "filterAria": "Filter invitations",
+ "emptyTitle": "No active invitations",
+ "emptyDesc": "Invitations for collaboration (trainer ↔ trainee) and to private gyms will appear here.",
+ "searchNoResults": "No results for the given query."
+}
diff --git a/app/src/i18n/locales/en/messages.json b/app/src/i18n/locales/en/messages.json
index 0967ef4..3c8368f 100644
--- a/app/src/i18n/locales/en/messages.json
+++ b/app/src/i18n/locales/en/messages.json
@@ -1 +1,43 @@
-{}
+{
+ "sortPrefix": "Sort: ",
+ "sort": {
+ "none": "None",
+ "unread": "Unread",
+ "name": "Name"
+ },
+ "groupByRole": "Group by role",
+ "roleTrainees": "Trainees",
+ "roleTrainers": "Trainers",
+ "youPrefix": "You: ",
+ "noMessageRow": "No messages",
+ "emptyTitle": "No conversations",
+ "emptyDesc": "A conversation appears once you have an active relationship with a trainer.",
+ "searchNoResults": "No results for the given query.",
+ "composerPlaceholder": "Write a message…",
+ "composerAria": "Message body",
+ "attachResult": "Attach result",
+ "removeAttachmentAria": "Remove attachment",
+ "send": "Send",
+ "attachEmpty": "No completed sessions to attach.",
+ "sessionLabel": "Session",
+ "chooseOption": "— choose —",
+ "exerciseLabel": "Exercise (optional)",
+ "exerciseAria": "Exercise",
+ "wholeSession": "Whole session",
+ "addAttachment": "Add attachment",
+ "attachHint": "The attachment will appear above the message field — you can write the body later.",
+ "openTraineePanel": "Open trainee panel",
+ "emptyThread": "No messages — write the first one.",
+ "attachOpenHint": "Click to open history",
+ "attachSessionResult": "Session result",
+ "attachSet": "Set {{n}}",
+ "attachSetsFrac": "{{done}}/{{total}} sets",
+ "ctx": {
+ "traineeWorkout": "Trainee workout",
+ "killstreak": "Killstreak",
+ "lastSession": "Last session",
+ "nextWorkout": "Next workout",
+ "yourWorkouts": "Your workouts",
+ "daysSep": " days · "
+ }
+}
diff --git a/app/src/i18n/locales/pl/common.json b/app/src/i18n/locales/pl/common.json
index 4048e00..07b9424 100644
--- a/app/src/i18n/locales/pl/common.json
+++ b/app/src/i18n/locales/pl/common.json
@@ -1,8 +1,11 @@
{
"appName": "FitOS",
+ "errorPrefix": "Błąd: ",
"cancel": "Anuluj",
"confirm": "Potwierdź",
"save": "Zapisz",
+ "saving": "Zapisywanie…",
+ "edit": "Edytuj",
"close": "Zamknij",
"closeNotification": "Zamknij powiadomienie",
"clear": "Wyczyść",
@@ -16,6 +19,8 @@
"toggleLanguage": "Zmień język",
"ok": "OK",
"remove": "Usuń",
+ "yes": "tak",
+ "no": "nie",
"loading": "Ładowanie…",
"back": "Wstecz",
"searchShort": "Szukaj…",
@@ -88,7 +93,11 @@
"setCount_few": "{{count}} serii",
"setCount_many": "{{count}} serii",
"setCount_other": "{{count}} serii",
- "weeksShort": "{{count}} tyg."
+ "weeksShort": "{{count}} tyg.",
+ "devices_one": "{{count}} urządzenie",
+ "devices_few": "{{count}} urządzenia",
+ "devices_many": "{{count}} urządzeń",
+ "devices_other": "{{count}} urządzeń"
},
"muscles": {
"chest": "Klatka",
diff --git a/app/src/i18n/locales/pl/feed.json b/app/src/i18n/locales/pl/feed.json
index 0967ef4..c616b37 100644
--- a/app/src/i18n/locales/pl/feed.json
+++ b/app/src/i18n/locales/pl/feed.json
@@ -1 +1,16 @@
-{}
+{
+ "markAll": "Oznacz wszystkie",
+ "markAllToast": "Wszystko oznaczone jako przeczytane",
+ "emptyTitle": "Brak aktualności",
+ "emptyDesc": "Tu pojawią się plany od trenera i ogłoszenia siłowni.",
+ "loadOlder": "Wczytaj starsze",
+ "loading": "Wczytywanie…",
+ "itemType": {
+ "planFromTrainer": "Plan od trenera",
+ "sharedPlan": "Udostępniony plan",
+ "gymDeleted": "Usunięta siłownia",
+ "announcement": "Ogłoszenie",
+ "hoursChange": "Zmiana godzin",
+ "exception": "Wyjątek w godzinach"
+ }
+}
diff --git a/app/src/i18n/locales/pl/gyms.json b/app/src/i18n/locales/pl/gyms.json
index 0967ef4..00b8cfc 100644
--- a/app/src/i18n/locales/pl/gyms.json
+++ b/app/src/i18n/locales/pl/gyms.json
@@ -1 +1,240 @@
-{}
+{
+ "upload": {
+ "maxFiles": "Maksymalnie {{count}} plików",
+ "badType": "Nieobsługiwany typ pliku: {{name}} (dozwolone: {{types}})",
+ "tooBig": "Plik {{name}} jest większy niż 5 MB"
+ },
+ "spec": {
+ "upToKg": "do {{v}} kg",
+ "fromKg": "od {{v}} kg",
+ "upToKmh": "do {{v}} km/h",
+ "inclineUpTo": "nachylenie do {{v}}%",
+ "minKg": "Min. obciążenie (kg)",
+ "maxKg": "Max. obciążenie (kg)",
+ "maxLoadKg": "Maksymalne obciążenie (kg)",
+ "maxSpeed": "Maks. prędkość (km/h)",
+ "maxIncline": "Maks. nachylenie (%)"
+ },
+ "sections": {
+ "savedToast": "Zapisano zmiany",
+ "nameLabel": "Nazwa",
+ "locationLabel": "Lokalizacja",
+ "capacityLabel": "Pojemność (osób)",
+ "privateEdit": "Prywatna (ukryta przed innymi — dostęp tylko po zaproszeniu)"
+ },
+ "photo": {
+ "addBtn": "Dodaj zdjęcia",
+ "formatsHint": "JPG, PNG lub WebP · maks. 5 MB",
+ "maxToast": "Maksymalnie {{count}} zdjęć na urządzenie",
+ "formatsToast": "Dozwolone formaty: JPG, PNG, WebP",
+ "sizeToast": "Maksymalny rozmiar zdjęcia to 5 MB",
+ "removeFileAria": "Usuń {{name}}"
+ },
+ "equipment": {
+ "inStock": "Pozycje na stanie ({{count}})",
+ "empty": "Brak urządzeń — dodaj pierwsze z katalogu poniżej.",
+ "qtyAria": "Ilość: {{name}}",
+ "editAria": "Edytuj {{name}}",
+ "removeAria": "Usuń {{name}}",
+ "editTitle": "Edycja: {{name}}",
+ "closeEditAria": "Zamknij edycję",
+ "itemParams": "Parametry pozycji",
+ "photosCount": "Zdjęcia ({{n}}/{{max}})",
+ "addPhotosLabel": "Dodaj zdjęcia urządzenia",
+ "restoreCatalog": "Przywróć specyfikację katalogu",
+ "restoreToast": "Przywrócono specyfikację katalogu",
+ "addTitle": "Dodaj urządzenie z katalogu",
+ "addAria": "Dodaj urządzenie",
+ "chooseDevice": "Wybierz urządzenie…",
+ "onStock": " (na stanie: {{count}})",
+ "qtyLabel": "Ilość",
+ "addBtn": "Dodaj",
+ "adding": "Dodawanie…",
+ "paramsLabel": "Parametry",
+ "addPhotosSwitch": "Dodaj zdjęcia do tej pozycji (opcjonalnie)",
+ "photosLabel": "Zdjęcia urządzenia",
+ "specRangeError": "Podaj zakres obciążeń (min i max w kg).",
+ "specMaxLoadError": "Podaj maksymalne obciążenie (kg).",
+ "specCardioError": "Podaj parametry urządzenia (prędkość lub nachylenie).",
+ "specEditError": "Podaj parametry lub przywróć specyfikację katalogu.",
+ "addedPartialToast": "Urządzenie dodane, ale nie udało się wgrać zdjęć",
+ "addedToast": "Sprzęt dodany",
+ "photosFailToast": "Nie udało się wgrać zdjęć",
+ "removedToast": "Usunięto: {{name}}"
+ },
+ "hours": {
+ "closed": "zamknięte"
+ },
+ "detail": {
+ "back": "Wstecz",
+ "notFound": "Nie znaleziono siłowni.",
+ "photoMore": "+{{count}} zdjęć",
+ "noEquipment": "Brak urządzeń.",
+ "photosAria": "Zdjęcia: {{name}}",
+ "places": "{{count}} miejsc",
+ "chipVirtual": "Wirtualna",
+ "chipPrivate": "Prywatna",
+ "galleryTitle": "Galeria zdjęć",
+ "equipmentTitle": "Urządzenia",
+ "equipmentDesc": "Maszyny i urządzenia dostępne w tej siłowni.",
+ "hoursTitle": "Godziny otwarcia",
+ "exceptionsLabel": "Wyjątki",
+ "dataTitle": "Dane",
+ "dataKind": "Rodzaj",
+ "dataPrivate": "Prywatna",
+ "dataCapacity": "Pojemność",
+ "dataStreet": "Ulica",
+ "dataPostalCity": "Kod i miasto",
+ "dataCountry": "Kraj",
+ "dataLocation": "Lokalizacja",
+ "groupEdit": "Edycja",
+ "groupGallery": "Galeria",
+ "groupEquipment": "Urządzenia",
+ "groupAnnouncements": "Ogłoszenia",
+ "groupInvites": "Zaproszenia",
+ "actionInfo": "Informacje",
+ "actionInvite": "Zaproś usera",
+ "actionWithdrawClaim": "Wycofaj wniosek",
+ "actionClaimVerify": "Złóż wniosek o weryfikację",
+ "actionDelete": "Usuń siłownię",
+ "claimWithdrawnToast": "Wniosek wycofany",
+ "modalInfo": "Informacje",
+ "modalGallery": "Zarządzaj galerią",
+ "modalEquipment": "Zarządzaj urządzeniami",
+ "modalAnnouncements": "Ogłoszenia",
+ "exceptionsTitle": "Wyjątki w harmonogramie",
+ "exceptionsDesc": "Jednorazowe zmiany na konkretny dzień (zamknięcie lub inne godziny).",
+ "deleteDesc": "Usunąć siłownię? Członkostwa zostaną usunięte, plany użytkowników zachowane."
+ },
+ "exceptions": {
+ "removedToast": "Wyjątek usunięty",
+ "empty": "Brak wyjątków.",
+ "addedToast": "Wyjątek dodany",
+ "addTitle": "Dodaj wyjątek — data i tryb dnia",
+ "dateAria": "Data wyjątku",
+ "closedMode": "Zamknięte",
+ "hoursMode": "Inne godziny",
+ "fromAria": "Od godziny",
+ "toAria": "Do godziny"
+ },
+ "announcements": {
+ "toastPublished": "Ogłoszenie opublikowane",
+ "toastRemoved": "Ogłoszenie usunięte",
+ "composerTitle": "Nowe ogłoszenie — trafi do wszystkich członków siłowni",
+ "titlePh": "Tytuł (np. Awarida klimatyzacji)",
+ "titleAria": "Tytuł ogłoszenia",
+ "bodyPh": "Treść ogłoszenia…",
+ "bodyAria": "Treść ogłoszenia",
+ "publish": "Opublikuj",
+ "publishing": "Publikowanie…",
+ "empty": "Brak ogłoszeń.",
+ "systemBadge": "Systemowe"
+ },
+ "invites": {
+ "desc": "Prywatna siłownia jest ukryta — zapraszaj określonych userów.",
+ "empty": "Brak wysłanych zaproszeń.",
+ "withdraw": "Wycofaj",
+ "toastWithdrawn": "Zaproszenie wycofane"
+ },
+ "page": {
+ "open": "Otwórz →",
+ "members": "{{count}} członków",
+ "ratingTitle": "Odsetek głosów „polecam”",
+ "voteTitle": "Czy ta wirtualna siłownia dobrze oddaje prawdziwą?",
+ "voteUpAria": "Polecam: {{name}}",
+ "voteDownAria": "Nie polecam: {{name}}",
+ "claimPending": "Wniosek oczekuje na weryfikację",
+ "rejected": "Odrzucono",
+ "resubmit": "Złóż ponownie",
+ "sentInvites": "Wysłane zaproszenia",
+ "tabMine": "Moje siłownie",
+ "tabVirtual": "Wirtualne",
+ "virtualHeading": "Wirtualne siłownie",
+ "emptyQueryTitle": "Brak wyników",
+ "emptyMineTitle": "Brak siłowni",
+ "emptyMineDesc": "Nie należysz do żadnej siłowni. Utwórz pierwszą lub dołącz do istniejącej.",
+ "emptyVirtualTitle": "Brak wirtualnych siłowni",
+ "emptyVirtualDesc": "Zaglądaj tu, by oceniać odwzorowanie prawdziwych siłowni."
+ },
+ "claim": {
+ "toastOk": "Wniosek złożony",
+ "titleVerify": "Wniosek o weryfikację: {{name}}",
+ "titleNew": "Nowy wniosek o siłownię",
+ "gymNameLabel": "Nazwa siłowni",
+ "gymNamePh": "np. Żelazna Świątynia",
+ "locationLabel": "Lokalizacja",
+ "locationPh": "np. ul. Długa 5, Warszawa",
+ "availabilityLabel": "Dostępność",
+ "capacityLabel": "Pojemność (osób)",
+ "capacityPh": "np. 50",
+ "descLabel": "Opis (dlaczego ta siłownia zasługuje na weryfikację / utworzenie)",
+ "descPh": "Krótki opis",
+ "addressLabel": "Pełny adres siłowni (opcjonalnie — nadpisze lokalizację)",
+ "addressPh": "np. ul. Długa 5, 00-050 Warszawa",
+ "companyLabel": "Nazwa firmy",
+ "companyPh": "np. Fit Sp. z o.o.",
+ "nipLabel": "NIP (10 cyfr)",
+ "nipPh": "np. 1234567890",
+ "phoneLabel": "Telefon",
+ "phonePh": "np. +48 600 000 000",
+ "emailLabel": "E-mail",
+ "emailPh": "np. kontakt@fitos.pl",
+ "docsLabel": "Dokumenty (opcjonalnie, do {{count}} plików JPG/PNG/PDF, maks. 5 MB każdy)",
+ "docsAria": "Dokumenty",
+ "removeFileAria": "Usuń {{name}}",
+ "submit": "Złóż wniosek",
+ "sending": "Wysyłanie…"
+ },
+ "create": {
+ "toastOk": "Siłownia utworzona",
+ "title": "Stwórz siłownię",
+ "nameLabel": "Nazwa",
+ "namePh": "np. Żelazna Świątynia",
+ "kindLabel": "Typ",
+ "kindVirtual": "Wirtualna",
+ "kindReal": "Realna",
+ "privateCheck": "Prywatna (ukryta przed innymi)",
+ "locationLabel": "Lokalizacja",
+ "locationPh": "np. Warszawa",
+ "availabilityLabel": "Dostępność",
+ "capacityLabel": "Pojemność (osób)",
+ "capacityPh": "np. 50",
+ "submit": "Utwórz",
+ "busy": "Utwierdanie…"
+ },
+ "gallery": {
+ "toastAdded": "Dodano zdjęcia",
+ "toastRemoved": "Usunięto zdjęcie",
+ "toastCover": "Ustawiono okładkę",
+ "hint": "Zdjęcia siłowni. Pierwsze zdjęcie (najmniejsza kolejność) jest okładką.",
+ "addBtn": "Dodaj zdjęcia",
+ "addAria": "Dodaj zdjęcia",
+ "empty": "Brak zdjęć.",
+ "coverBadge": "Okładka",
+ "setCoverAria": "Ustaw jako okładka",
+ "removeAria": "Usuń zdjęcie",
+ "confirmTitle": "Usuń zdjęcie",
+ "confirmText": "Czy na pewno chcesz usunąć to zdjęcie?"
+ },
+ "invite": {
+ "toastOk": "Zaproszono: {{name}}",
+ "title": "Zaproś usera: {{name}}",
+ "firstNameLabel": "Imię",
+ "firstNamePh": "np. Jan",
+ "lastNameLabel": "Nazwisko",
+ "lastNamePh": "np. Kowalski",
+ "empty": "Brak użytkowników o podanych danych.",
+ "submit": "Zaproś",
+ "busy": "Zapraszanie…"
+ },
+ "join": {
+ "toastOk": "Dołączono do siłowni: {{name}}",
+ "title": "Dołącz do siłowni",
+ "searchPh": "Szukaj siłowni…",
+ "searchAria": "Szukaj siłowni do dołączenia",
+ "emptyQuery": "Brak wyników dla podanego zapytania.",
+ "emptyAll": "Brak siłowni do dołączenia — należysz już do wszystkich.",
+ "submit": "Dołącz",
+ "busy": "Dołączanie…"
+ }
+}
diff --git a/app/src/i18n/locales/pl/invitations.json b/app/src/i18n/locales/pl/invitations.json
new file mode 100644
index 0000000..6c58f61
--- /dev/null
+++ b/app/src/i18n/locales/pl/invitations.json
@@ -0,0 +1,23 @@
+{
+ "expiryOverdue": "po terminie",
+ "expiryToday": "wygasa dziś",
+ "expiryTomorrow": "wygasa jutro",
+ "expiryInDays": "wygasa za {{count}} dni",
+ "received": "Otrzymane",
+ "sent": "Wysłane",
+ "decline": "Odrzuć",
+ "accept": "Przyjmij",
+ "withdraw": "Wycofaj",
+ "toastAccepted": "Zaproszenie przyjęte",
+ "toastDeclined": "Zaproszenie odrzucone",
+ "toastWithdrawn": "Zaproszenie wycofane",
+ "badgeGym": "Siłownia",
+ "invitedBy": "zaprosił: {{name}}",
+ "toPerson": "do: {{name}}",
+ "scopeIn": "Przychodzące",
+ "scopeOut": "Wychodzące",
+ "filterAria": "Filtruj zaproszenia",
+ "emptyTitle": "Brak aktywnych zaproszeń",
+ "emptyDesc": "Zaproszenia do współpracy (trener ↔ podopieczny) i do prywatnych siłowni pojawią się tutaj.",
+ "searchNoResults": "Brak wyników dla podanego zapytania."
+}
diff --git a/app/src/i18n/locales/pl/messages.json b/app/src/i18n/locales/pl/messages.json
index 0967ef4..b5f6156 100644
--- a/app/src/i18n/locales/pl/messages.json
+++ b/app/src/i18n/locales/pl/messages.json
@@ -1 +1,43 @@
-{}
+{
+ "sortPrefix": "Sortuj: ",
+ "sort": {
+ "none": "Brak",
+ "unread": "Nieprzeczytane",
+ "name": "Nazwa"
+ },
+ "groupByRole": "Grupuj wg roli",
+ "roleTrainees": "Podopieczni",
+ "roleTrainers": "Trenerzy",
+ "youPrefix": "Ty: ",
+ "noMessageRow": "Brak wiadomości",
+ "emptyTitle": "Brak rozmów",
+ "emptyDesc": "Rozmowa pojawi się po nawiązaniu aktywnej relacji z trenerem.",
+ "searchNoResults": "Brak wyników dla podanego zapytania.",
+ "composerPlaceholder": "Napisz wiadomość…",
+ "composerAria": "Treść wiadomości",
+ "attachResult": "Załącz wynik",
+ "removeAttachmentAria": "Usuń załącznik",
+ "send": "Wyślij",
+ "attachEmpty": "Brak ukończonych sesji do załączenia.",
+ "sessionLabel": "Sesja",
+ "chooseOption": "— wybierz —",
+ "exerciseLabel": "Ćwiczenie (opcjonalnie)",
+ "exerciseAria": "Ćwiczenie",
+ "wholeSession": "Cała sesja",
+ "addAttachment": "Dodaj załącznik",
+ "attachHint": "Załącznik pojawi się nad polem wiadomości — treść możesz dopisać później.",
+ "openTraineePanel": "Otwórz panel podopiecznego",
+ "emptyThread": "Brak wiadomości — napisz pierwszą.",
+ "attachOpenHint": "Kliknij, aby otworzyć historię",
+ "attachSessionResult": "Wynik sesji",
+ "attachSet": "Seria {{n}}",
+ "attachSetsFrac": "{{done}}/{{total}} serii",
+ "ctx": {
+ "traineeWorkout": "Trening podopiecznego",
+ "killstreak": "Killstreak",
+ "lastSession": "Ostatnia sesja",
+ "nextWorkout": "Następny trening",
+ "yourWorkouts": "Twoje treningi",
+ "daysSep": " dni · "
+ }
+}
diff --git a/app/src/lib/equipment.ts b/app/src/lib/equipment.ts
index dec961d..937c8a3 100644
--- a/app/src/lib/equipment.ts
+++ b/app/src/lib/equipment.ts
@@ -1,18 +1,7 @@
+import i18n from '../i18n';
import type { Equipment, EquipmentKind, EquipmentSpec, GymEquipment } from '../api/types';
import { localizedName } from './localizedName';
-export const EQUIPMENT_KIND_LABELS: Record = {
- DUMBBELL: 'Hantle',
- KETTLEBELL: 'Kettlebell',
- BARBELL: 'Sztanga',
- CABLE: 'Wyciąg',
- MACHINE: 'Maszyna',
- BENCH: 'Ławka',
- CARDIO: 'Cardio',
- BODYWEIGHT: 'Masa ciała',
- OTHER: 'Inne',
-};
-
function fmtKg(value: number): string {
return Number.isInteger(value) ? String(value) : value.toFixed(1).replace(/\.0$/, '');
}
@@ -34,12 +23,14 @@ export function formatEquipmentSpec(spec: EquipmentSpec | null | undefined): str
? `${fmtKg(spec.minKg)} kg`
: `${fmtKg(spec.minKg)}–${fmtKg(spec.maxKg)} kg`,
);
- } else if (spec.maxKg != null) parts.push(`do ${fmtKg(spec.maxKg)} kg`);
- else parts.push(`od ${fmtKg(spec.minKg!)} kg`);
+ } else if (spec.maxKg != null) parts.push(i18n.t('gyms:spec.upToKg', { v: fmtKg(spec.maxKg) }));
+ else parts.push(i18n.t('gyms:spec.fromKg', { v: fmtKg(spec.minKg!) }));
}
- if (spec.maxLoadKg != null) parts.push(`do ${fmtKg(spec.maxLoadKg)} kg`);
- if (spec.maxSpeedKmh != null) parts.push(`do ${fmtKg(spec.maxSpeedKmh)} km/h`);
- if (spec.maxInclinePct != null) parts.push(`nachylenie do ${fmtKg(spec.maxInclinePct)}%`);
+ if (spec.maxLoadKg != null) parts.push(i18n.t('gyms:spec.upToKg', { v: fmtKg(spec.maxLoadKg) }));
+ if (spec.maxSpeedKmh != null)
+ parts.push(i18n.t('gyms:spec.upToKmh', { v: fmtKg(spec.maxSpeedKmh) }));
+ if (spec.maxInclinePct != null)
+ parts.push(i18n.t('gyms:spec.inclineUpTo', { v: fmtKg(spec.maxInclinePct) }));
return parts.length ? parts.join(', ') : null;
}
@@ -90,12 +81,12 @@ export function specFromFields(
if (LOAD_RANGE_KINDS.includes(kind)) {
const minKg = parseNum(f.minKg);
const maxKg = parseNum(f.maxKg);
- if (minKg == null || maxKg == null) return { error: 'Podaj zakres obciążeń (min i max w kg).' };
+ if (minKg == null || maxKg == null) return { error: i18n.t('gyms:equipment.specRangeError') };
return { spec: { minKg, maxKg } };
}
if (MAX_LOAD_KINDS.includes(kind)) {
const maxLoadKg = parseNum(f.maxLoadKg);
- if (maxLoadKg == null) return { error: 'Podaj maksymalne obciążenie (kg).' };
+ if (maxLoadKg == null) return { error: i18n.t('gyms:equipment.specMaxLoadError') };
return { spec: { maxLoadKg } };
}
if (kind === 'CARDIO') {
diff --git a/app/src/pages/Invitations.tsx b/app/src/pages/Invitations.tsx
index 3e9b8bf..7b3c7e5 100644
--- a/app/src/pages/Invitations.tsx
+++ b/app/src/pages/Invitations.tsx
@@ -1,4 +1,5 @@
import { useEffect, useState, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import { useQueryClient } from '@tanstack/react-query';
import { ArrowDownLeft, ArrowUpRight, Mail } from 'lucide-react';
import {
@@ -29,15 +30,16 @@ function daysLeft(expiresAt: string): number {
}
function ExpiryChip({ expiresAt }: { expiresAt: string }) {
+ const { t } = useTranslation('invitations');
const left = daysLeft(expiresAt);
const label =
left < 0
- ? 'po terminie'
+ ? t('expiryOverdue')
: left === 0
- ? 'wygasa dziś'
+ ? t('expiryToday')
: left === 1
- ? 'wygasa jutro'
- : `wygasa za ${left} dni`;
+ ? t('expiryTomorrow')
+ : t('expiryInDays', { count: left });
return (
void;
onWithdraw: () => void;
}) {
+ const { t } = useTranslation('invitations');
return (
- Odrzuć
+ {t('decline')}
- Przyjmij
+ {t('accept')}
>
) : (
- Wycofaj
+ {t('withdraw')}
)}
@@ -125,6 +128,7 @@ function InvitationRow({
function GymInvitationRow({ invitation }: { invitation: GymInvitation }) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('invitations');
const act = async (kind: 'accept' | 'decline' | 'withdraw') => {
try {
@@ -138,10 +142,10 @@ function GymInvitationRow({ invitation }: { invitation: GymInvitation }) {
]);
push(
kind === 'accept'
- ? 'Zaproszenie przyjęte'
+ ? t('toastAccepted')
: kind === 'decline'
- ? 'Zaproszenie odrzucone'
- : 'Zaproszenie wycofane',
+ ? t('toastDeclined')
+ : t('toastWithdrawn'),
'success',
);
} catch (e) {
@@ -158,11 +162,13 @@ function GymInvitationRow({ invitation }: { invitation: GymInvitation }) {
Siłownia}
+ badge={{t('badgeGym')}}
meta={
<>
{invitation.gym.location ? `${invitation.gym.location} · ` : ''}
- {invitation.direction === 'received' ? `zaprosił: ${personName}` : `do: ${personName}`}
+ {invitation.direction === 'received'
+ ? t('invitedBy', { name: personName })
+ : t('toPerson', { name: personName })}
>
}
expiresAt={invitation.expiresAt}
@@ -177,6 +183,7 @@ function GymInvitationRow({ invitation }: { invitation: GymInvitation }) {
function CoachingInvitationRow({ invitation }: { invitation: Invitation }) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('invitations');
const other = invitation.other;
const name = other ? displayName(other) : '—';
@@ -192,10 +199,10 @@ function CoachingInvitationRow({ invitation }: { invitation: Invitation }) {
]);
push(
kind === 'accept'
- ? 'Zaproszenie przyjęte'
+ ? t('toastAccepted')
: kind === 'decline'
- ? 'Zaproszenie odrzucone'
- : 'Zaproszenie wycofane',
+ ? t('toastDeclined')
+ : t('toastWithdrawn'),
'success',
);
} catch (e) {
@@ -207,7 +214,7 @@ function CoachingInvitationRow({ invitation }: { invitation: Invitation }) {
Trener}
+ badge={{t('nav:roleTrainer')}}
meta={<>{other ? `${other.email}${other.phone ? ` · ${other.phone}` : ''}` : ''}>}
expiresAt={invitation.expiresAt}
direction={invitation.direction}
@@ -219,6 +226,7 @@ function CoachingInvitationRow({ invitation }: { invitation: Invitation }) {
}
export default function Invitations() {
+ const { t } = useTranslation('invitations');
const { data, isLoading, error } = useInvitations();
const { data: gymData, isLoading: gymLoading, error: gymError } = useGymInvitations();
const [scope, setScope] = useState<'all' | 'in' | 'out'>('all');
@@ -233,7 +241,7 @@ export default function Invitations() {
// Wyszukiwarka w top menu ma sens dopiero przy więcej niż jednym zaproszeniu.
useTopbar({
- title: 'Zaproszenia',
+ title: t('nav:invitations'),
search: all.length > 1 ? 'invitations' : undefined,
});
@@ -270,15 +278,15 @@ export default function Invitations() {
/* Filtr zakresu (front-end): wszystkie / przychodzące / wychodzące. */
const scopes: { id: 'all' | 'in' | 'out'; label: string; count: number }[] = [
- { id: 'all', label: 'Wszystkie', count: all.length },
+ { id: 'all', label: t('common:all'), count: all.length },
{
id: 'in',
- label: 'Przychodzące',
+ label: t('scopeIn'),
count: all.filter((i) => i.data.direction === 'received').length,
},
{
id: 'out',
- label: 'Wychodzące',
+ label: t('scopeOut'),
count: all.filter((i) => i.data.direction === 'sent').length,
},
];
@@ -291,19 +299,25 @@ export default function Invitations() {
+ )}
{!loading && !error && !gymError && all.length === 0 && (
)}
{!loading && !error && !gymError && all.length > 0 && (
-
+
{scopes.map((s) => (
0 && filtered.length === 0 && (
- Brak wyników dla podanego zapytania.
+ {t('searchNoResults')}
)}
{scope !== 'out' && received.length > 0 && (
- Otrzymane
+ {t('received')}
{received.map(renderRow)}
@@ -339,7 +353,7 @@ export default function Invitations() {
{scope !== 'in' && sent.length > 0 && (
- Wysłane
+ {t('sent')}
{sent.map(renderRow)}
diff --git a/app/src/pages/announcements/Announcements.tsx b/app/src/pages/announcements/Announcements.tsx
index 005302c..c185345 100644
--- a/app/src/pages/announcements/Announcements.tsx
+++ b/app/src/pages/announcements/Announcements.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next';
import { useQueryClient } from '@tanstack/react-query';
import { Megaphone } from 'lucide-react';
import { markFeedAllRead, useFeed } from '../../api/queries';
@@ -7,7 +8,8 @@ import { useToast } from '../../components/toast';
import { useTopbar } from '../../topbar';
export default function Announcements() {
- useTopbar({ title: 'Aktualności' });
+ const { t } = useTranslation('feed');
+ useTopbar({ title: t('nav:announcements') });
const queryClient = useQueryClient();
const { push } = useToast();
const { data, isLoading, error, hasNextPage, isFetchingNextPage, fetchNextPage } = useFeed(20);
@@ -17,14 +19,20 @@ export default function Announcements() {
try {
await markFeedAllRead();
await queryClient.invalidateQueries({ queryKey: ['feed'] });
- push('Wszystko oznaczone jako przeczytane', 'success');
+ push(t('markAllToast'), 'success');
} catch (err) {
push((err as Error).message, 'error');
}
};
if (isLoading) return ;
- if (error) return Błąd: {(error as Error).message};
+ if (error)
+ return (
+
+ {t('common:errorPrefix')}
+ {(error as Error).message}
+
+ );
return (
<>
@@ -32,16 +40,12 @@ export default function Announcements() {
{items.some((i) => !i.read) && (
void markAll()}>
- Oznacz wszystkie
+ {t('markAll')}
)}
{items.length === 0 ? (
-
+
) : (
{items.map((item) => (
@@ -57,7 +61,7 @@ export default function Announcements() {
disabled={isFetchingNextPage}
onClick={() => void fetchNextPage()}
>
- {isFetchingNextPage ? 'Wczytywanie…' : 'Wczytaj starsze'}
+ {isFetchingNextPage ? t('loading') : t('loadOlder')}
)}
diff --git a/app/src/pages/gyms/GymDetail.tsx b/app/src/pages/gyms/GymDetail.tsx
index 5135bcf..4bd4708 100644
--- a/app/src/pages/gyms/GymDetail.tsx
+++ b/app/src/pages/gyms/GymDetail.tsx
@@ -28,7 +28,7 @@ import {
withdrawGymInvitation,
} from '../../api/queries';
import type { Gym, GymEquipment, GymException } from '../../api/types';
-import { fmtDateTime } from '../../lib/format';
+import { fmtDate, fmtDateTime } from '../../lib/format';
import { localizedName } from '../../lib/localizedName';
import { formatGymEquipment } from '../../lib/equipment';
import {
@@ -49,7 +49,7 @@ import { useToast } from '../../components/toast';
import { Avatar } from '../../components/Avatar';
import { AuthImage } from '../../components/AuthImage';
import { useTopbar, type TopbarAction, type TopbarCustomGroup } from '../../topbar';
-import { normalizeAvailability, TIME_SLOTS } from '../../lib/availability';
+import { normalizeAvailability, TIME_SLOTS, dayFull } from '../../lib/availability';
import ClaimModal from '../../components/gyms/ClaimModal';
import InviteGymModal from '../../components/gyms/InviteGymModal';
import GymGallery from '../../components/gyms/GymGallery';
@@ -57,11 +57,11 @@ import { EquipmentSection, GymEditForm } from './GymSections';
/* Lista godzin otwarcia: wiersz na dzień (czytelna w wąskiej kolumnie), „dziś” wyróżnione. */
function HoursList({ gym }: { gym: Gym }) {
+ const { t } = useTranslation('gyms');
const availability = normalizeAvailability(gym.availability);
const todayIdx = (new Date().getDay() + 6) % 7;
- const DOWS = ['Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota', 'Niedziela'];
const fmt = (r: { start: string; end: string } | null) =>
- r ? `${r.start}–${r.end}` : 'zamknięte';
+ r ? `${r.start}–${r.end}` : t('hours.closed');
return (
{availability.map((day, i) => (
@@ -72,10 +72,10 @@ function HoursList({ gym }: { gym: Gym }) {
}`}
>
- {DOWS[i]}
+ {dayFull(i)}
{i === todayIdx && (
- dziś
+ {t('common:fmt.today')}
)}
@@ -90,9 +90,10 @@ function HoursList({ gym }: { gym: Gym }) {
/* Mozaika galerii (read-only): pierwsze zdjęcie duże, reszta siatką, „+N” na końcu. */
function GalleryMosaic({ gym }: { gym: Gym & { photos: { id: string; url: string }[] } }) {
+ const { t } = useTranslation('gyms');
const photos = gym.photos;
if (photos.length === 0) {
- return
Brak zdjęć.
;
+ return
{t('gallery.empty')}
;
}
const [first, ...rest] = photos;
return (
@@ -110,7 +111,7 @@ function GalleryMosaic({ gym }: { gym: Gym & { photos: { id: string; url: string
))}
{rest.length > 3 && (
- +{rest.length - 3} zdjęć
+ {t('detail.photoMore', { count: rest.length - 3 })}
)}
@@ -121,8 +122,9 @@ function GalleryMosaic({ gym }: { gym: Gym & { photos: { id: string; url: string
function EquipmentTiles({ gym }: { gym: Gym }) {
const [preview, setPreview] = useState(null);
const { i18n } = useTranslation();
+ const { t } = useTranslation('gyms');
if (gym.equipment.length === 0) {
- return Brak urządzeń.
;
+ return {t('detail.noEquipment')}
;
}
const photos = preview?.photos ?? [];
return (
@@ -149,7 +151,9 @@ function EquipmentTiles({ gym }: { gym: Gym }) {
key={e.id}
type="button"
onClick={() => setPreview(e)}
- aria-label={`Zdjęcia: ${localizedName(e.equipment, i18n.language)}`}
+ aria-label={t('detail.photosAria', {
+ name: localizedName(e.equipment, i18n.language),
+ })}
className="flex cursor-pointer items-center gap-2 rounded-[10px] border border-line bg-card/50 px-3 py-2.5 text-left text-[0.85rem] font-semibold hover:border-accent/55"
>
{content}
@@ -167,7 +171,11 @@ function EquipmentTiles({ gym }: { gym: Gym }) {
setPreview(null)}
- title={preview ? `Zdjęcia: ${localizedName(preview.equipment, i18n.language)}` : ''}
+ title={
+ preview
+ ? t('detail.photosAria', { name: localizedName(preview.equipment, i18n.language) })
+ : ''
+ }
>
{photos.map((p) => (
@@ -188,6 +196,7 @@ function EquipmentTiles({ gym }: { gym: Gym }) {
function ExceptionsList({ gymId, canManage }: { gymId: string; canManage: boolean }) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('gyms');
const { data, isLoading } = useGymExceptions(gymId);
const exceptions: GymException[] = data?.exceptions ?? [];
@@ -195,7 +204,7 @@ function ExceptionsList({ gymId, canManage }: { gymId: string; canManage: boolea
try {
await deleteGymException(gymId, exceptionId);
await queryClient.invalidateQueries({ queryKey: ['gym-exceptions', gymId] });
- push('Wyjątek usunięty', 'success');
+ push(t('exceptions.removedToast'), 'success');
} catch (err) {
push((err as Error).message, 'error');
}
@@ -203,7 +212,7 @@ function ExceptionsList({ gymId, canManage }: { gymId: string; canManage: boolea
if (isLoading) return
;
if (exceptions.length === 0) {
- return
Brak wyjątków.
;
+ return
{t('exceptions.empty')}
;
}
return (
@@ -213,14 +222,16 @@ function ExceptionsList({ gymId, canManage }: { gymId: string; canManage: boolea
className="flex items-center gap-3 rounded-[10px] border border-dashed border-danger/40 bg-danger/7 px-3 py-2"
>
- {new Date(ex.date).toLocaleDateString('pl-PL')}
+ {fmtDate(ex.date)}
- {ex.availability ? `${ex.availability.start}–${ex.availability.end}` : 'zamknięte'}
+ {ex.availability
+ ? `${ex.availability.start}–${ex.availability.end}`
+ : t('hours.closed')}
{canManage && (
void remove(ex.id)}>
- Usuń
+ {t('common:remove')}
)}
@@ -233,6 +244,7 @@ function ExceptionsList({ gymId, canManage }: { gymId: string; canManage: boolea
function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void }) {
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('gyms');
const [date, setDate] = useState('');
const [closed, setClosed] = useState(true);
const [start, setStart] = useState('18:00');
@@ -244,7 +256,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
try {
await createGymException(gymId, { date, availability: closed ? null : { start, end } });
await queryClient.invalidateQueries({ queryKey: ['gym-exceptions', gymId] });
- push('Wyjątek dodany', 'success');
+ push(t('exceptions.addedToast'), 'success');
setDate('');
onDone();
} catch (err) {
@@ -257,7 +269,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
return (
- Dodaj wyjątek — data i tryb dnia
+ {t('exceptions.addTitle')}
{/* wiersz 1: data + tryb; na wąskich ekranach każde przechodzi na pełną szerokość */}
@@ -265,7 +277,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
type="date"
value={date}
onChange={(e) => setDate(e.target.value)}
- aria-label="Data wyjątku"
+ aria-label={t('exceptions.dateAria')}
className="w-full min-w-0 sm:w-44 sm:flex-none"
required
/>
@@ -278,7 +290,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
closed ? 'bg-accent text-accent-ink' : 'text-dim hover:text-ink'
}`}
>
- Zamknięte
+ {t('exceptions.closedMode')}
void
!closed ? 'bg-accent text-accent-ink' : 'text-dim hover:text-ink'
}`}
>
- Inne godziny
+ {t('exceptions.hoursMode')}
@@ -298,7 +310,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
)}
@@ -337,7 +349,7 @@ function ExceptionAddForm({ gymId, onDone }: { gymId: string; onDone: () => void
disabled={busy || !date}
className="w-full sm:w-auto"
>
- {busy ? 'Dodawanie…' : 'Dodaj'}
+ {busy ? t('equipment.adding') : t('equipment.addBtn')}
)}
@@ -368,6 +380,7 @@ export default function GymDetail() {
const navigate = useNavigate();
const queryClient = useQueryClient();
const { push } = useToast();
+ const { t } = useTranslation('gyms');
const { data, isLoading, error } = useGymDetail(id);
const { data: claimsData } = useMyGymClaims();
const gym = data?.gym;
@@ -410,7 +423,7 @@ export default function GymDetail() {
queryClient.invalidateQueries({ queryKey: ['gyms', 'claims'] }),
queryClient.invalidateQueries({ queryKey: ['gyms', 'virtual'] }),
]);
- push('Wniosek wycofany', 'success');
+ push(t('detail.claimWithdrawnToast'), 'success');
} catch (e) {
push((e as Error).message, 'error');
} finally {
@@ -424,39 +437,45 @@ export default function GymDetail() {
? [
{
id: 'edit',
- label: 'Edycja',
+ label: t('detail.groupEdit'),
icon: Pencil,
- actions: [{ label: 'Informacje', onClick: () => setEditOpen(true) }],
+ actions: [{ label: t('detail.actionInfo'), onClick: () => setEditOpen(true) }],
},
...(gym.kind === 'REAL'
? [
{
id: 'gallery',
- label: 'Galeria',
+ label: t('detail.groupGallery'),
icon: ImageIcon,
- actions: [{ label: 'Galeria', onClick: () => setGalleryOpen(true) }],
+ actions: [
+ { label: t('detail.groupGallery'), onClick: () => setGalleryOpen(true) },
+ ],
} as TopbarCustomGroup,
]
: []),
{
id: 'equipment',
- label: 'Urządzenia',
+ label: t('detail.groupEquipment'),
icon: Wrench,
- actions: [{ label: 'Urządzenia', onClick: () => setEquipmentOpen(true) }],
+ actions: [{ label: t('detail.groupEquipment'), onClick: () => setEquipmentOpen(true) }],
},
{
id: 'announcements',
- label: 'Ogłoszenia',
+ label: t('detail.groupAnnouncements'),
icon: Megaphone,
- actions: [{ label: 'Ogłoszenia', onClick: () => setAnnouncementsOpen(true) }],
+ actions: [
+ { label: t('detail.groupAnnouncements'), onClick: () => setAnnouncementsOpen(true) },
+ ],
},
...(gym.kind === 'VIRTUAL' && gym.isPrivate
? [
{
id: 'invite',
- label: 'Zaproszenia',
+ label: t('detail.groupInvites'),
icon: UserPlus,
- actions: [{ label: 'Zaproś usera', onClick: () => setInviteOpen(true) }],
+ actions: [
+ { label: t('detail.actionInvite'), onClick: () => setInviteOpen(true) },
+ ],
} as TopbarCustomGroup,
]
: []),
@@ -470,7 +489,7 @@ export default function GymDetail() {
? claim
? ([
{
- label: 'Wycofaj wniosek',
+ label: t('detail.actionWithdrawClaim'),
variant: 'secondary',
disabled: claimBusy,
onClick: () => void withdrawClaim(),
@@ -478,17 +497,21 @@ export default function GymDetail() {
] as TopbarAction[])
: ([
{
- label: 'Złóż wniosek o weryfikację',
+ label: t('detail.actionClaimVerify'),
variant: 'secondary',
onClick: () => setClaimOpen(true),
},
] as TopbarAction[])
: []),
- { label: 'Usuń siłownię', variant: 'danger', onClick: () => setConfirmOpen(true) },
+ {
+ label: t('detail.actionDelete'),
+ variant: 'danger',
+ onClick: () => setConfirmOpen(true),
+ },
]
: undefined;
- useTopbar({ title: 'Siłownie', back: '/gyms', groups, actions: ownerActions });
+ useTopbar({ title: t('nav:gyms'), back: '/gyms', groups, actions: ownerActions });
if (isLoading) return
;
if (error || !gym) {
@@ -496,9 +519,9 @@ export default function GymDetail() {
<>
- Wstecz
+ {t('common:back')}
-
Nie znaleziono siłowni.
+
{t('detail.notFound')}
>
);
}
@@ -550,25 +573,25 @@ export default function GymDetail() {
- {gym.capacity != null ? `${gym.capacity} miejsc` : '—'}
+ {gym.capacity != null ? t('detail.places', { count: gym.capacity }) : '—'}
- {gym.equipment.length} urządzeń
+ {t('common:counters.devices', { count: gym.equipment.length })}
{gym.kind === 'VIRTUAL' && (
- Wirtualna
+ {t('detail.chipVirtual')}
)}
{gym.isPrivate && (
- Prywatna
+ {t('detail.chipPrivate')}
)}
{isOwner && (
- Właściciel
+ {t('common:statuses.gymRole.OWNER')}
)}