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
@@ -21,8 +21,12 @@ export function validAnalyticsId(field: AnalyticsIdField, value: unknown): null
|
||||
return v && ANALYTICS_ID_FORMATS[field].test(v) ? v : null
|
||||
}
|
||||
|
||||
/** Payload field `validate` for an ID field. */
|
||||
/** Payload field `validate` for an ID field. The message follows the editor's admin language. */
|
||||
export const validateAnalyticsId =
|
||||
(field: AnalyticsIdField, example: string) =>
|
||||
(value: null | string | undefined): string | true =>
|
||||
!value?.trim() || validAnalyticsId(field, value) !== null || `Unexpected format — expected something like ${example}`
|
||||
(value: null | string | undefined, options?: { req?: { i18n?: { language?: string } } }): string | true => {
|
||||
if (!value?.trim() || validAnalyticsId(field, value) !== null) {return true}
|
||||
return options?.req?.i18n?.language === 'pl'
|
||||
? `Sprawdź identyfikator. Powinien wyglądać tak: ${example}.`
|
||||
: `Check the ID. It should look like this: ${example}.`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user