Skip to content

Commit 8671d68

Browse files
committed
i18n: translate collection labels, descriptions and comments to English
All field labels, admin descriptions, error messages, select option labels, admin group names, and code comments across all 11 collections and access module.
1 parent ad5e6d7 commit 8671d68

12 files changed

Lines changed: 145 additions & 145 deletions

File tree

src/access/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import type { Access, FieldAccess } from 'payload'
22

3-
/** Czy zalogowany użytkownik to pracownik/admin (kolekcja `users`). */
3+
/** Whether the logged-in user is a staff member/admin (collection `users`). */
44
export const isAdmin: Access = ({ req: { user } }) => user?.collection === 'users'
55

6-
/** Wersja dla dostępu na poziomie pola (zwraca boolean). */
6+
/** Field-level access version (returns boolean). */
77
export const isAdminField: FieldAccess = ({ req: { user } }) => user?.collection === 'users'
88

9-
/** Każdy zalogowany (admin lub klient) może czytać. */
9+
/** Any authenticated user (admin or client) can read. */
1010
export const isAuthenticated: Access = ({ req: { user } }) => Boolean(user)
1111

1212
/**
13-
* Admin widzi wszystko; klient tylko własny rekord (po polu `id`).
14-
* Używane dla kolekcji `clients`.
13+
* Admin sees everything; a client sees only their own record (by the `id` field).
14+
* Used for the `clients` collection.
1515
*/
1616
export const adminOrSelf: Access = ({ req: { user } }) => {
1717
if (!user) return false
@@ -20,14 +20,14 @@ export const adminOrSelf: Access = ({ req: { user } }) => {
2020
}
2121

2222
/**
23-
* Admin widzi wszystko; klient tylko dokumenty, gdzie pole `client`
24-
* wskazuje na niego. Używane dla `workout-logs` i `assignments`.
23+
* Admin sees everything; a client sees only documents where the `client` field
24+
* points to them. Used for `workout-logs` and `assignments`.
2525
*/
2626
export const adminOrOwnByClient: Access = ({ req: { user } }) => {
2727
if (!user) return false
2828
if (user.collection === 'users') return true
2929
return { client: { equals: user.id } }
3030
}
3131

32-
/** @deprecated alias zachowany dla czytelności w workout-logs */
32+
/** @deprecated alias kept for readability in workout-logs */
3333
export const adminOrOwnLogs = adminOrOwnByClient

src/collections/clients/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Clients: CollectionConfig = {
77
admin: {
88
useAsTitle: 'email',
99
defaultColumns: ['name', 'email'],
10-
group: 'Konta',
10+
group: 'Accounts',
1111
},
1212
access: {
1313
create: isAdmin,
@@ -20,19 +20,19 @@ export const Clients: CollectionConfig = {
2020
{
2121
name: 'name',
2222
type: 'text',
23-
label: 'Imię i nazwisko',
23+
label: 'Full name',
2424
},
2525
{
2626
name: 'plans',
2727
type: 'join',
2828
collection: 'plans',
2929
on: 'client',
30-
label: 'Plany klienta',
30+
label: "Client's plans",
3131
},
3232
{
3333
name: 'notes',
3434
type: 'textarea',
35-
label: 'Notatki trenera',
35+
label: 'Trainer notes',
3636
access: {
3737
read: isAdminField,
3838
update: isAdminField,

src/collections/exercises/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Exercises: CollectionConfig = {
77
admin: {
88
useAsTitle: 'name',
99
defaultColumns: ['name', 'muscleGroup', 'equipment'],
10-
group: 'Katalog',
10+
group: 'Catalog',
1111
},
1212
access: {
1313
create: isAdmin,
@@ -20,36 +20,36 @@ export const Exercises: CollectionConfig = {
2020
name: 'name',
2121
type: 'text',
2222
required: true,
23-
label: 'Nazwa',
23+
label: 'Name',
2424
},
2525
{
2626
name: 'trackingType',
2727
type: 'select',
28-
label: 'Typ pomiaru',
28+
label: 'Tracking type',
2929
defaultValue: DEFAULT_TRACKING,
3030
options: trackingOptions,
31-
admin: { description: 'Decyduje, które pola pokazuje formularz logowania serii' },
31+
admin: { description: 'Determines which fields are shown in the set logging form' },
3232
},
3333
{
3434
name: 'description',
3535
type: 'textarea',
36-
label: 'Opis techniczny',
36+
label: 'Technical description',
3737
},
3838
{
3939
name: 'videoUrl',
4040
type: 'text',
41-
label: 'Wideo (link)',
42-
admin: { description: 'URL do filmu instruktażowego (np. YouTube)' },
41+
label: 'Video (link)',
42+
admin: { description: 'URL to instructional video (e.g. YouTube)' },
4343
},
4444
{
4545
name: 'muscleGroup',
4646
type: 'text',
47-
label: 'Partia mięśniowa',
47+
label: 'Muscle group',
4848
},
4949
{
5050
name: 'equipment',
5151
type: 'text',
52-
label: 'Sprzęt',
52+
label: 'Equipment',
5353
},
5454
],
5555
}

src/collections/exercises/types.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Jedno źródło prawdy: typ pomiaru ćwiczeniaktóre metryki zbieramy.
3-
* Używane przez: formularz logowania (które inputy) i hook SetLog (czyszczenie pól spoza typu).
2+
* Single source of truth: exercise tracking typewhich metrics we collect.
3+
* Used by: the logging form (which inputs to show) and the SetLog hook (clearing fields outside the type).
44
*/
55

66
export type MetricField = 'weight' | 'reps' | 'rir' | 'distanceM' | 'durationSec'
@@ -11,34 +11,34 @@ export type MetricMeta = {
1111
label: string
1212
placeholder: string
1313
numeric: boolean
14-
// Pole złożone: wejście min + sek, w bazie suma sekund
14+
// Composite field: input in min + sec, stored in DB as total seconds
1515
composite?: 'duration'
16-
// Jednostki wejścia na froncie; w bazie wartość bazowa (factor = ile jednostek bazowych na 1 wybraną)
16+
// Front-end input units; stored in DB as base value (factor = how many base units per 1 selected unit)
1717
units?: { default: string; options: UnitOption[] }
1818
}
1919

2020
export const METRIC_FIELDS: Record<MetricField, MetricMeta> = {
21-
weight: { label: 'Ciężar (kg)', placeholder: 'ciężar', numeric: true },
22-
reps: { label: 'Powtórzenia', placeholder: 'powtórzenia', numeric: false },
23-
rir: { label: 'RIR', placeholder: 'RIR (rezerwa)', numeric: false },
24-
distanceM: { label: 'Dystans (m)', placeholder: 'dystans', numeric: true },
25-
durationSec: { label: 'Czas', placeholder: 'minuty / sekundy', numeric: true, composite: 'duration' },
21+
weight: { label: 'Weight (kg)', placeholder: 'weight', numeric: true },
22+
reps: { label: 'Reps', placeholder: 'reps', numeric: false },
23+
rir: { label: 'RIR', placeholder: 'RIR (reserve)', numeric: false },
24+
distanceM: { label: 'Distance (m)', placeholder: 'distance', numeric: true },
25+
durationSec: { label: 'Duration', placeholder: 'minutes / seconds', numeric: true, composite: 'duration' },
2626
}
2727

2828
export const ALL_METRIC_FIELDS = Object.keys(METRIC_FIELDS) as MetricField[]
2929

3030
export const TRACKING: Record<TrackingType, { label: string; fields: MetricField[] }> = {
31-
strength: { label: 'Siłowe', fields: ['weight', 'reps', 'rir'] },
31+
strength: { label: 'Strength', fields: ['weight', 'reps', 'rir'] },
3232
cardio: { label: 'Cardio', fields: ['distanceM', 'durationSec'] },
3333
}
3434

3535
export const DEFAULT_TRACKING: TrackingType = 'strength'
3636

37-
/** Lista pól dla danego typu (z fallbackiem do domyślnego). */
37+
/** List of fields for the given type (with fallback to the default). */
3838
export const trackingFields = (t?: string | null): MetricField[] =>
3939
t && t in TRACKING ? TRACKING[t as TrackingType].fields : TRACKING[DEFAULT_TRACKING].fields
4040

41-
/** Opcje selecta dla Payload. */
41+
/** Select options for Payload. */
4242
export const trackingOptions = (Object.keys(TRACKING) as TrackingType[]).map((value) => ({
4343
label: TRACKING[value].label,
4444
value,

src/collections/microcycles/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export const Microcycles: CollectionConfig = {
55
admin: {
66
useAsTitle: 'title',
77
defaultColumns: ['title', 'rpe', 'order', 'plan'],
8-
group: 'Plan treningowy',
8+
group: 'Training plan',
99
},
1010
fields: [
1111
{
1212
name: 'title',
1313
type: 'text',
1414
required: true,
15-
label: 'Nazwa mikrocyklu',
15+
label: 'Microcycle name',
1616
},
1717
{
1818
name: 'plan',
@@ -25,12 +25,12 @@ export const Microcycles: CollectionConfig = {
2525
name: 'rpe',
2626
type: 'number',
2727
label: 'RPE',
28-
admin: { description: 'Docelowy RPE mikrocyklu (6–9)' },
28+
admin: { description: 'Target RPE for the microcycle (6–9)' },
2929
},
3030
{
3131
name: 'order',
3232
type: 'number',
33-
label: 'Kolejność',
33+
label: 'Order',
3434
defaultValue: 0,
3535
},
3636
],

src/collections/plans/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const Plans: CollectionConfig = {
66
admin: {
77
useAsTitle: 'title',
88
defaultColumns: ['title', 'client', 'status', 'updatedAt'],
9-
group: 'Plan treningowy',
9+
group: 'Training plan',
1010
},
1111
access: {
1212
create: isAdmin,
@@ -19,7 +19,7 @@ export const Plans: CollectionConfig = {
1919
name: 'client',
2020
type: 'relationship',
2121
relationTo: 'clients',
22-
label: 'Klient (właściciel planu)',
22+
label: 'Client (plan owner)',
2323
admin: { position: 'sidebar' },
2424
},
2525
{
@@ -29,9 +29,9 @@ export const Plans: CollectionConfig = {
2929
defaultValue: 'active',
3030
admin: { position: 'sidebar' },
3131
options: [
32-
{ label: 'Aktywny', value: 'active' },
33-
{ label: 'Wstrzymany', value: 'paused' },
34-
{ label: 'Zakończony', value: 'completed' },
32+
{ label: 'Active', value: 'active' },
33+
{ label: 'Paused', value: 'paused' },
34+
{ label: 'Completed', value: 'completed' },
3535
],
3636
},
3737
{
@@ -40,13 +40,13 @@ export const Plans: CollectionConfig = {
4040
{
4141
name: 'startDate',
4242
type: 'date',
43-
label: 'Początek',
43+
label: 'Start date',
4444
admin: { width: '50%', date: { pickerAppearance: 'dayOnly' } },
4545
},
4646
{
4747
name: 'endDate',
4848
type: 'date',
49-
label: 'Koniec',
49+
label: 'End date',
5050
admin: { width: '50%', date: { pickerAppearance: 'dayOnly' } },
5151
},
5252
],
@@ -55,18 +55,18 @@ export const Plans: CollectionConfig = {
5555
name: 'title',
5656
type: 'text',
5757
required: true,
58-
label: 'Nazwa planu',
58+
label: 'Plan name',
5959
},
6060
{
6161
name: 'description',
6262
type: 'textarea',
63-
label: 'Opis',
63+
label: 'Description',
6464
},
6565
{
6666
name: 'source',
6767
type: 'text',
68-
label: 'Źródło (plik)',
69-
admin: { description: 'Skąd zaimportowano plan' },
68+
label: 'Source (file)',
69+
admin: { description: 'Where the plan was imported from' },
7070
},
7171
],
7272
}

src/collections/round-logs/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const RoundLogs: CollectionConfig = {
66
admin: {
77
useAsTitle: 'id',
88
defaultColumns: ['session', 'group', 'roundNumber', 'status', 'client'],
9-
group: 'Dziennik treningów',
9+
group: 'Training log',
1010
},
1111
access: {
1212
create: ({ req: { user } }) => Boolean(user),
@@ -30,38 +30,38 @@ export const RoundLogs: CollectionConfig = {
3030
type: 'relationship',
3131
relationTo: 'workout-logs',
3232
required: true,
33-
label: 'Sesja',
33+
label: 'Session',
3434
},
3535
{
3636
name: 'group',
3737
type: 'relationship',
3838
relationTo: 'workout-groups',
3939
required: true,
40-
label: 'Grupa',
40+
label: 'Group',
4141
},
4242
{
4343
name: 'client',
4444
type: 'relationship',
4545
relationTo: 'clients',
46-
label: 'Klient',
46+
label: 'Client',
4747
defaultValue: ({ user }) => (user?.collection === 'clients' ? user.id : undefined),
4848
},
4949
{
5050
name: 'roundNumber',
5151
type: 'number',
52-
label: 'Nr rundy',
52+
label: 'Round number',
5353
required: true,
5454
},
5555
{
5656
name: 'startedAt',
5757
type: 'date',
58-
label: 'Rozpoczęto',
58+
label: 'Started at',
5959
admin: { date: { pickerAppearance: 'dayAndTime' } },
6060
},
6161
{
6262
name: 'finishedAt',
6363
type: 'date',
64-
label: 'Zakończono',
64+
label: 'Finished at',
6565
admin: { date: { pickerAppearance: 'dayAndTime' } },
6666
},
6767
{
@@ -70,9 +70,9 @@ export const RoundLogs: CollectionConfig = {
7070
label: 'Status',
7171
defaultValue: 'completed',
7272
options: [
73-
{ label: 'Ukończona', value: 'completed' },
74-
{ label: 'Częściowa', value: 'partial' },
75-
{ label: 'Pominięta', value: 'skipped' },
73+
{ label: 'Completed', value: 'completed' },
74+
{ label: 'Partial', value: 'partial' },
75+
{ label: 'Skipped', value: 'skipped' },
7676
],
7777
},
7878
],

0 commit comments

Comments
 (0)