Admin panel in English and Polish, reworded per docs/dev/admin-ux.md

- admin-i18n module: AdminText { en, pl }, component texts under the ipal
  namespace (project translations win), en + pl admin languages when the
  project sets none (project's supportedLanguages wins)
- every plugin label, description, option, tab and group as { en, pl };
  explicit labels instead of auto-labels; sentence case; glossary terms
- visible renames (slugs, names, data unchanged): Cookie banner, Form
  messages, Privacy group, Search engines, Maintenance, Spam protection,
  E-mail sending, stats nav link Overview (hidden without access)
- Polish visitor defaults by page locale: cookie banner, form messages,
  validators, lightbox, accessibility widget; {field} uses the label
- fixes: e-mail status banner used Turnstile wording; developer words and
  env var names out of editor messages; stats numbers/dates in the admin
  language; test e-mail no longer says ipal-kit
- test/adminUx.test.ts: length limits, en + pl present, no developer words

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-27 15:46:25 +01:00
co-authored by Claude Opus 5.5
parent eeac33ed2f
commit 6b46bc0c14
108 changed files with 2806 additions and 981 deletions
+86 -47
View File
@@ -5,14 +5,22 @@ import { validateFaviconField } from '../../../modules/seo/index.js'
/**
* General site identity fields.
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
*
* Order (admin-ux §7): what visitors see first (name, description, images),
* then the profiles list, then the title format options in one row. The row is
* presentation only — data stays flat.
*/
export const generalFields: Field[] = [
{
name: 'siteName',
type: 'text',
admin: {
description: 'Used in page titles and Open Graph metadata.',
description: {
en: 'Shown in page titles and when a link is shared.',
pl: 'Widoczna w tytułach stron i przy udostępnianiu linków.',
},
},
label: { en: 'Site name', pl: 'Nazwa witryny' },
localized: true,
required: true,
},
@@ -20,76 +28,107 @@ export const generalFields: Field[] = [
name: 'siteDescription',
type: 'textarea',
admin: {
description:
'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.',
description: {
en: 'Shown in search results for pages without their own description.',
pl: 'Widoczny w wynikach wyszukiwania stron bez własnego opisu.',
},
},
label: { en: 'Site description', pl: 'Opis witryny' },
localized: true,
},
{
name: 'titleOrder',
type: 'select',
admin: {
description: 'Which comes first in browser tabs.',
},
defaultValue: 'page-first',
options: [
{ label: 'Page first — About Us | Acme', value: 'page-first' },
{ label: 'Site first — Acme | About Us', value: 'site-first' },
],
},
{
name: 'titleSeparator',
type: 'select',
admin: {
description: 'Separates the page title from the site name in browser tabs.',
},
defaultValue: '|',
options: [
{ label: 'Pipe — Page | Site', value: '|' },
{ label: 'Dash — Page – Site', value: '–' },
{ label: 'Hyphen — Page - Site', value: '-' },
{ label: 'Bullet — Page · Site', value: '·' },
{ label: 'Slash — Page / Site', value: '/' },
],
},
{
name: 'logo',
type: 'upload',
label: { en: 'Logo', pl: 'Logo' },
relationTo: 'media',
},
{
name: 'favicon',
type: 'upload',
admin: {
description: 'Primary site logo.',
description: {
en: 'Square PNG or SVG, at least 48×48 px, shown in browser tabs and search results.',
pl: 'Kwadratowy plik PNG lub SVG, co najmniej 48×48 px, widoczny na kartach przeglądarki i w wynikach wyszukiwania.',
},
},
hooks: {
// Warn the editor if the favicon is too small / not square for Google.
beforeValidate: [validateFaviconField],
},
label: { en: 'Site icon (favicon)', pl: 'Ikona witryny (favicon)' },
relationTo: 'media',
},
{
name: 'defaultShareImage',
type: 'upload',
admin: {
description: 'Fallback Open Graph image when a page has none.',
description: {
en: 'Shown when a link to a page without its own image is shared.',
pl: 'Widoczny przy udostępnianiu linku do strony bez własnego obrazu.',
},
},
label: { en: 'Share image', pl: 'Obraz udostępniania' },
relationTo: 'media',
},
{
name: 'sameAs',
type: 'array',
admin: {
description:
'Official profiles of this business (Google Business Profile, LinkedIn, Facebook, Wikipedia…). Tells search engines and AI which entity the site belongs to.',
description: {
en: 'Your business on Google, LinkedIn, Facebook and similar, so search engines and AI assistants recognise you.',
pl: 'Profile firmy w Google, LinkedIn, Facebooku itp., dzięki którym wyszukiwarki i asystenci AI rozpoznają firmę.',
},
initCollapsed: true,
},
fields: [{ name: 'url', type: 'text', required: true, validate: (v: unknown) => (typeof v === 'string' && /^https?:\/\/\S+$/.test(v)) || 'Full URL, e.g. https://www.linkedin.com/company/acme' }],
labels: { plural: 'Profiles', singular: 'Profile' },
fields: [
{
name: 'url',
type: 'text',
admin: { placeholder: 'https://www.linkedin.com/company/acme' },
label: { en: 'Address (URL)', pl: 'Adres (URL)' },
required: true,
validate: (v: unknown, { req }: { req?: { i18n?: { language?: string } } } = {}) =>
(typeof v === 'string' && /^https?:\/\/\S+$/.test(v)) ||
(req?.i18n?.language === 'pl'
? 'Wpisz pełny adres, np. https://www.linkedin.com/company/acme'
: 'Enter a full address, e.g. https://www.linkedin.com/company/acme'),
},
],
label: { en: 'Official profiles', pl: 'Oficjalne profile' },
labels: { plural: { en: 'Profiles', pl: 'Profile' }, singular: { en: 'Profile', pl: 'Profil' } },
},
{
name: 'favicon',
type: 'upload',
admin: {
description:
'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',
},
hooks: {
// Warn the editor if the favicon is too small / not square for Google.
beforeValidate: [validateFaviconField],
},
relationTo: 'media',
type: 'row',
fields: [
{
name: 'titleOrder',
type: 'select',
admin: {
description: {
en: 'Order of the page name and the site name in the browser tab.',
pl: 'Kolejność nazwy strony i nazwy witryny na karcie przeglądarki.',
},
},
defaultValue: 'page-first',
label: { en: 'Title order', pl: 'Kolejność w tytule' },
options: [
{ label: { en: 'Page first — About us | Acme', pl: 'Najpierw strona — O nas | Acme' }, value: 'page-first' },
{ label: { en: 'Site first — Acme | About us', pl: 'Najpierw witryna — Acme | O nas' }, value: 'site-first' },
],
},
{
name: 'titleSeparator',
type: 'select',
defaultValue: '|',
label: { en: 'Title separator', pl: 'Separator w tytule' },
options: [
{ label: { en: 'Pipe — Page | Site', pl: 'Kreska pionowa — Strona | Witryna' }, value: '|' },
{ label: { en: 'Dash — Page – Site', pl: 'Półpauza — Strona – Witryna' }, value: '–' },
{ label: { en: 'Hyphen — Page - Site', pl: 'Dywiz — Strona - Witryna' }, value: '-' },
{ label: { en: 'Bullet — Page · Site', pl: 'Kropka — Strona · Witryna' }, value: '·' },
{ label: { en: 'Slash — Page / Site', pl: 'Ukośnik — Strona / Witryna' }, value: '/' },
],
},
],
},
]