From 7ddb8a16f024fe8256bb44241b5e34d9a47ffc3f Mon Sep 17 00:00:00 2001 From: rasm-its Date: Sat, 1 Aug 2026 00:19:44 +0200 Subject: [PATCH] I18nConfig locales readonly - accept as const configs --- dist/modules/i18n/types.d.ts | 2 +- dist/modules/i18n/types.js.map | 2 +- docs/install.md | 0 src/modules/i18n/types.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 docs/install.md diff --git a/dist/modules/i18n/types.d.ts b/dist/modules/i18n/types.d.ts index 5fcd706..764df84 100644 --- a/dist/modules/i18n/types.d.ts +++ b/dist/modules/i18n/types.d.ts @@ -16,5 +16,5 @@ export type I18nConfig = { defaultLocale: string; /** Enable locale fallback when content is missing (defaults to true) */ fallback?: boolean; - locales: [LocaleDefinition, ...LocaleDefinition[]]; + locales: readonly [LocaleDefinition, ...LocaleDefinition[]]; }; diff --git a/dist/modules/i18n/types.js.map b/dist/modules/i18n/types.js.map index a962d21..5aaa89d 100644 --- a/dist/modules/i18n/types.js.map +++ b/dist/modules/i18n/types.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/modules/i18n/types.ts"],"sourcesContent":["/**\n * Single locale definition provided by the client project.\n */\nexport type LocaleDefinition = {\n /** BCP-47 language code, e.g. 'pl', 'en', 'de' */\n code: string\n /** Human-readable label, e.g. 'Polski', 'English' */\n label: string\n /** Right-to-left script (defaults to false) */\n rtl?: boolean\n}\n\n/**\n * Full i18n configuration passed through plugin options.\n */\nexport type I18nConfig = {\n defaultLocale: string\n /** Enable locale fallback when content is missing (defaults to true) */\n fallback?: boolean\n locales: [LocaleDefinition, ...LocaleDefinition[]]\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAUD;;CAEC,GACD,WAKC"} \ No newline at end of file +{"version":3,"sources":["../../../src/modules/i18n/types.ts"],"sourcesContent":["/**\n * Single locale definition provided by the client project.\n */\nexport type LocaleDefinition = {\n /** BCP-47 language code, e.g. 'pl', 'en', 'de' */\n code: string\n /** Human-readable label, e.g. 'Polski', 'English' */\n label: string\n /** Right-to-left script (defaults to false) */\n rtl?: boolean\n}\n\n/**\n * Full i18n configuration passed through plugin options.\n */\nexport type I18nConfig = {\n defaultLocale: string\n /** Enable locale fallback when content is missing (defaults to true) */\n fallback?: boolean\n locales: readonly [LocaleDefinition, ...LocaleDefinition[]]\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAUD;;CAEC,GACD,WAKC"} \ No newline at end of file diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..e69de29 diff --git a/src/modules/i18n/types.ts b/src/modules/i18n/types.ts index cf96b2e..905d6e5 100644 --- a/src/modules/i18n/types.ts +++ b/src/modules/i18n/types.ts @@ -17,5 +17,5 @@ export type I18nConfig = { defaultLocale: string /** Enable locale fallback when content is missing (defaults to true) */ fallback?: boolean - locales: [LocaleDefinition, ...LocaleDefinition[]] + locales: readonly [LocaleDefinition, ...LocaleDefinition[]] }