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:
co-authored by
Claude Opus 5.5
parent
eeac33ed2f
commit
6b46bc0c14
@@ -1,5 +1,7 @@
|
||||
import type { Field } from 'payload'
|
||||
|
||||
import type { AdminText } from '../../../modules/admin-i18n/index.js'
|
||||
|
||||
import { validateAnalyticsId } from '../../../modules/analytics/idFormats.js'
|
||||
|
||||
/**
|
||||
@@ -7,59 +9,61 @@ import { validateAnalyticsId } from '../../../modules/analytics/idFormats.js'
|
||||
* read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only
|
||||
* after the matching consent category is granted (see modules/analytics).
|
||||
*/
|
||||
|
||||
const GOOGLE: AdminText = {
|
||||
en: "Follows the visitor's choice in the cookie banner (Google Consent Mode).",
|
||||
pl: 'Uwzględnia wybór odwiedzającego w banerze cookies (Google Consent Mode).',
|
||||
}
|
||||
const AFTER_MARKETING: AdminText = {
|
||||
en: 'Loads after the visitor accepts marketing cookies.',
|
||||
pl: 'Wczytuje się po zaakceptowaniu przez odwiedzającego cookies marketingowych.',
|
||||
}
|
||||
const AFTER_ANALYTICS: AdminText = {
|
||||
en: 'Loads after the visitor accepts analytics cookies.',
|
||||
pl: 'Wczytuje się po zaakceptowaniu przez odwiedzającego cookies analitycznych.',
|
||||
}
|
||||
|
||||
export const analyticsFields: Field[] = [
|
||||
{
|
||||
name: 'ga4MeasurementId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',
|
||||
placeholder: 'G-XXXXXXXXXX',
|
||||
},
|
||||
admin: { description: GOOGLE, placeholder: 'G-XXXXXXXXXX' },
|
||||
label: { en: 'Google Analytics 4 ID', pl: 'ID Google Analytics 4' },
|
||||
validate: validateAnalyticsId('ga4MeasurementId', 'G-XXXXXXXXXX'),
|
||||
},
|
||||
{
|
||||
name: 'gtmContainerId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Google Tag Manager container ID. (Google — Consent Mode)',
|
||||
placeholder: 'GTM-XXXXXXX',
|
||||
},
|
||||
admin: { description: GOOGLE, placeholder: 'GTM-XXXXXXX' },
|
||||
label: { en: 'Google Tag Manager ID', pl: 'ID Google Tag Manager' },
|
||||
validate: validateAnalyticsId('gtmContainerId', 'GTM-XXXXXXX'),
|
||||
},
|
||||
{
|
||||
name: 'metaPixelId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',
|
||||
placeholder: '1234567890123456',
|
||||
},
|
||||
admin: { description: AFTER_MARKETING, placeholder: '1234567890123456' },
|
||||
label: { en: 'Meta Pixel ID', pl: 'ID Meta Pixel' },
|
||||
validate: validateAnalyticsId('metaPixelId', '1234567890123456'),
|
||||
},
|
||||
{
|
||||
name: 'clarityProjectId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',
|
||||
placeholder: 'abcdefghij',
|
||||
},
|
||||
admin: { description: AFTER_ANALYTICS, placeholder: 'abcdefghij' },
|
||||
label: { en: 'Microsoft Clarity ID', pl: 'ID Microsoft Clarity' },
|
||||
validate: validateAnalyticsId('clarityProjectId', 'abcdefghij'),
|
||||
},
|
||||
{
|
||||
name: 'linkedInPartnerId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',
|
||||
placeholder: '1234567',
|
||||
},
|
||||
admin: { description: AFTER_MARKETING, placeholder: '1234567' },
|
||||
label: { en: 'LinkedIn Insight Tag ID', pl: 'ID LinkedIn Insight Tag' },
|
||||
validate: validateAnalyticsId('linkedInPartnerId', '1234567'),
|
||||
},
|
||||
{
|
||||
name: 'tiktokPixelId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'TikTok Pixel ID. Loads only after MARKETING consent.',
|
||||
placeholder: 'CXXXXXXXXXXXXXXXXXXX',
|
||||
},
|
||||
admin: { description: AFTER_MARKETING, placeholder: 'CXXXXXXXXXXXXXXXXXXX' },
|
||||
label: { en: 'TikTok Pixel ID', pl: 'ID TikTok Pixel' },
|
||||
validate: validateAnalyticsId('tiktokPixelId', 'CXXXXXXXXXXXXXXXXXXX'),
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user