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
@@ -224,8 +224,9 @@ describe('one-call helpers — layout, page, GEO routes', () => {
|
||||
const shell = await h().getSiteShell('pl')
|
||||
expect(shell.turnstileSiteKey).toBeNull()
|
||||
expect(shell.consent.buttons.acceptAll).toEqual(expect.any(String))
|
||||
expect(shell.formTexts).toMatchObject({ next: 'Next', stepOf: 'Step {current} of {total}' })
|
||||
expect(shell.lightboxTexts).toMatchObject({ close: 'Close', counter: '{current} / {total}' })
|
||||
// a Polish page gets the Polish defaults while the panel is empty
|
||||
expect(shell.formTexts).toMatchObject({ next: 'Dalej', stepOf: 'Krok {current} z {total}' })
|
||||
expect(shell.lightboxTexts).toMatchObject({ close: 'Zamknij', counter: '{current} / {total}' })
|
||||
expect(shell.jsonLd.map((n) => n['@type'])).toEqual(['WebSite', 'Organization'])
|
||||
expect(shell.jsonLd.every((n) => !('@context' in n))).toBe(true)
|
||||
const custom = createContentHelpers({ baseUrl: 'https://acme.pl', config: configPromise, i18n, siteJsonLd: false })
|
||||
@@ -319,7 +320,8 @@ describe('consent texts', () => {
|
||||
expect(empty.title).toBeUndefined()
|
||||
expect(empty.settingsDescription).toBeUndefined()
|
||||
expect(empty.alwaysActiveLabel).toBeUndefined()
|
||||
expect(empty.buttons.close).toBe('Close')
|
||||
expect(empty.buttons.close).toBe('Zamknij') // Polish default on a Polish page
|
||||
expect((await getConsentTexts({ config, locale: 'en', payload, privacyPolicy: false })).buttons.close).toBe('Close')
|
||||
|
||||
await payload.updateGlobal({
|
||||
slug: 'cookie-settings' as never,
|
||||
@@ -354,10 +356,10 @@ describe('cookie table', () => {
|
||||
{ name: '_ga', category: 'analytics', duration: '2 lata', provider: 'Google', purpose: 'Statystyki' },
|
||||
])
|
||||
|
||||
// the same rows feed the detailed settings window, with English labels until the panel has them
|
||||
// the same rows feed the detailed settings window, with the page language's default labels until the panel has them
|
||||
const texts = await getConsentTexts({ config: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }] }, locale: 'pl', payload, privacyPolicy: false })
|
||||
expect(texts.cookies).toEqual([{ name: '_ga', category: 'analytics', duration: '2 lata', provider: 'Google', purpose: 'Statystyki' }])
|
||||
expect(texts.details).toEqual({ cookies: 'Cookies used', duration: 'Duration', provider: 'Provider', purpose: 'Purpose' })
|
||||
expect(texts.details).toEqual({ cookies: 'Używane cookies', duration: 'Okres', provider: 'Dostawca', purpose: 'Cel' })
|
||||
|
||||
await payload.updateGlobal({
|
||||
slug: 'cookie-settings' as never,
|
||||
|
||||
Reference in New Issue
Block a user