@pie-qti/i18n 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/core/I18n.d.ts +0 -1
  2. package/dist/core/I18n.js.map +1 -1
  3. package/dist/core/I18nProvider.d.ts +0 -1
  4. package/dist/core/I18nProvider.js.map +1 -1
  5. package/dist/core/types.d.ts +0 -1
  6. package/dist/core/types.js.map +1 -1
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/locales/ar-SA.d.ts +0 -1
  10. package/dist/locales/ar-SA.js.map +1 -1
  11. package/dist/locales/en-US.d.ts +0 -1
  12. package/dist/locales/en-US.js.map +1 -1
  13. package/dist/locales/es-ES.d.ts +0 -1
  14. package/dist/locales/es-ES.js.map +1 -1
  15. package/dist/locales/fr-FR.d.ts +0 -1
  16. package/dist/locales/fr-FR.js.map +1 -1
  17. package/dist/locales/nl-NL.d.ts +0 -1
  18. package/dist/locales/nl-NL.js.map +1 -1
  19. package/dist/locales/ro-RO.d.ts +0 -1
  20. package/dist/locales/ro-RO.js.map +1 -1
  21. package/dist/locales/th-TH.d.ts +0 -1
  22. package/dist/locales/th-TH.js.map +1 -1
  23. package/dist/locales/zh-CN.d.ts +0 -1
  24. package/dist/locales/zh-CN.js.map +1 -1
  25. package/dist/providers/SvelteI18nProvider.d.ts +0 -1
  26. package/dist/providers/SvelteI18nProvider.js.map +1 -1
  27. package/package.json +5 -9
  28. package/dist/core/I18n.d.ts.map +0 -1
  29. package/dist/core/I18nProvider.d.ts.map +0 -1
  30. package/dist/core/types.d.ts.map +0 -1
  31. package/dist/index.d.ts.map +0 -1
  32. package/dist/locales/ar-SA.d.ts.map +0 -1
  33. package/dist/locales/en-US.d.ts.map +0 -1
  34. package/dist/locales/es-ES.d.ts.map +0 -1
  35. package/dist/locales/fr-FR.d.ts.map +0 -1
  36. package/dist/locales/nl-NL.d.ts.map +0 -1
  37. package/dist/locales/ro-RO.d.ts.map +0 -1
  38. package/dist/locales/th-TH.d.ts.map +0 -1
  39. package/dist/locales/zh-CN.d.ts.map +0 -1
  40. package/dist/providers/SvelteI18nProvider.d.ts.map +0 -1
  41. package/src/components/LocaleSwitcher.svelte +0 -145
  42. package/src/components/README.md +0 -224
@@ -1 +1 @@
1
- {"version":3,"file":"SvelteI18nProvider.js","sourceRoot":"","sources":["../../src/providers/SvelteI18nProvider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,OAAO,kBAAkB;IACtB,QAAQ,CAAe;IAE/B,YAAY,QAAsB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAED,SAAS;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAc;QAC7B,4EAA4E;QAC5E,IAAI,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;YACrF,oFAAoF;YACpF,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAA6B,CAAC,CAAC;YAC/D,CAAC;YAAC,MAAM,CAAC;gBACR,iEAAiE;gBACjE,OAAO,CAAC,KAAK,CAAC,kBAAkB,MAAM,6DAA6D,CAAC,CAAC;YACtG,CAAC;QACF,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;YAC/B,MAAM,MAAM,CAAC;QACd,CAAC;QAED,iEAAiE;QACjE,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;YACzC,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;QAED,0CAA0C;QAC1C,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3C,CAAC","sourcesContent":["/**\n * Svelte-specific I18n provider.\n *\n * Wraps any I18nProvider and persists locale to localStorage. Locale changes\n * trigger a page reload so that all components pick up the new locale without\n * needing reactive stores.\n */\n\nimport type { I18nProvider, PluralOptions } from '../core/I18nProvider.js';\nimport type { LocaleCode, FrameworkLocaleCode, LocaleMessages } from '../core/types.js';\n\nexport class SvelteI18nProvider implements I18nProvider {\n\tprivate provider: I18nProvider;\n\n\tconstructor(provider: I18nProvider) {\n\t\tthis.provider = provider;\n\t}\n\n\tgetLocale(): string {\n\t\treturn this.provider.getLocale();\n\t}\n\n\tasync setLocale(locale: string): Promise<void> {\n\t\t// Load the locale if using DefaultI18nProvider (only for framework locales)\n\t\tif ('loadLocale' in this.provider && typeof this.provider.loadLocale === 'function') {\n\t\t\t// Only load framework locales; custom locales should be provided via customMessages\n\t\t\ttry {\n\t\t\t\tawait this.provider.loadLocale(locale as FrameworkLocaleCode);\n\t\t\t} catch {\n\t\t\t\t// If framework locale doesn't exist, assume it's a custom locale\n\t\t\t\tconsole.debug(`[i18n] Locale '${locale}' not available as framework locale, assuming custom locale`);\n\t\t\t}\n\t\t}\n\n\t\tconst result = this.provider.setLocale(locale);\n\t\tif (result instanceof Promise) {\n\t\t\tawait result;\n\t\t}\n\n\t\t// Store locale in localStorage for persistence across page loads\n\t\tif (typeof localStorage !== 'undefined') {\n\t\t\tlocalStorage.setItem('pie-qti-locale', locale);\n\t\t}\n\n\t\t// Trigger page reload to apply new locale\n\t\t// This simplifies the codebase significantly by eliminating the need for\n\t\t// complex reactivity patterns in every component\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.location.reload();\n\t\t}\n\t}\n\n\tt(key: string, defaultOrValues?: Record<string, any> | string, values?: Record<string, any>): string {\n\t\treturn this.provider.t(key, defaultOrValues, values);\n\t}\n\n\tplural(key: string, options: PluralOptions): string {\n\t\treturn this.provider.plural?.(key, options) ?? this.provider.t(key, options);\n\t}\n\n\tformatNumber(value: number, options?: Intl.NumberFormatOptions): string {\n\t\tif (this.provider.formatNumber) {\n\t\t\treturn this.provider.formatNumber(value, options);\n\t\t}\n\t\treturn new Intl.NumberFormat(this.provider.getLocale(), options).format(value);\n\t}\n\n\tformatDate(date: Date, options?: Intl.DateTimeFormatOptions): string {\n\t\tif (this.provider.formatDate) {\n\t\t\treturn this.provider.formatDate(date, options);\n\t\t}\n\t\treturn new Intl.DateTimeFormat(this.provider.getLocale(), options).format(date);\n\t}\n}\n\n/**\n * Factory function to create a Svelte i18n provider\n * @param provider - Base I18nProvider to wrap\n */\nexport function createSvelteI18nProvider(provider: I18nProvider): SvelteI18nProvider {\n\treturn new SvelteI18nProvider(provider);\n}\n\n/**\n * Helper function to create a Svelte provider with the default implementation\n * @param locale - Initial locale code (ignored if locale is stored in localStorage)\n * @param customMessages - Optional custom translations to add or override framework defaults\n */\nexport async function createDefaultSvelteI18nProvider(\n\tlocale: LocaleCode = 'en-US',\n\tcustomMessages?: Record<string, LocaleMessages>\n): Promise<SvelteI18nProvider> {\n\tconst { DefaultI18nProvider } = await import('../core/I18n.js');\n\n\t// DefaultI18nProvider constructor reads from localStorage automatically\n\t// Pass the locale parameter as fallback if nothing in localStorage\n\tconst provider = new DefaultI18nProvider(locale, customMessages);\n\n\t// Get the actual locale that will be used (either from localStorage or fallback)\n\tconst actualLocale = provider.getLocale() as FrameworkLocaleCode;\n\n\t// Load the locale if it's not en-US (en-US is already loaded eagerly)\n\tif (actualLocale !== 'en-US') {\n\t\ttry {\n\t\t\tawait provider.loadLocale(actualLocale);\n\t\t} catch (error) {\n\t\t\t// If framework locale doesn't exist, assume it's a custom locale\n\t\t\tconsole.debug(`[i18n] Locale '${actualLocale}' not available as framework locale, assuming custom locale`);\n\t\t}\n\t}\n\n\treturn createSvelteI18nProvider(provider);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-qti/i18n",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Internationalization (i18n) package for PIE-QTI player ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,12 +11,11 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js"
13
13
  },
14
- "./components/*": "./src/components/*",
15
14
  "./locales/*": "./dist/locales/*"
16
15
  },
17
16
  "scripts": {
18
- "build": "if [ \"$PIE_QTI_DEV_FAST_BUILD\" = \"1\" ]; then tsc; else bun run check-translations && tsc; fi",
19
- "build:skip-check": "tsc",
17
+ "build": "rm -rf dist tsconfig.tsbuildinfo && if [ \"$PIE_QTI_DEV_FAST_BUILD\" = \"1\" ]; then tsc; else bun run check-translations && tsc; fi",
18
+ "build:skip-check": "rm -rf dist tsconfig.tsbuildinfo && tsc",
20
19
  "clean": "rm -rf dist",
21
20
  "test": "bun test tests",
22
21
  "typecheck": "tsc --noEmit",
@@ -34,10 +33,8 @@
34
33
  "localization"
35
34
  ],
36
35
  "license": "MIT",
37
- "dependencies": {
38
- "svelte": "^5.54.0"
39
- },
40
36
  "devDependencies": {
37
+ "svelte": "^5.43.3",
41
38
  "typescript": "^5.9.3",
42
39
  "@types/bun": "^1.3.11"
43
40
  },
@@ -58,7 +55,6 @@
58
55
  "node": ">=20.19.0"
59
56
  },
60
57
  "files": [
61
- "dist",
62
- "src/components"
58
+ "dist"
63
59
  ]
64
60
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18n.d.ts","sourceRoot":"","sources":["../../src/core/I18n.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAa9F,qBAAa,mBAAoB,YAAW,YAAY;IACvD,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC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CAC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAK5C,MAAM,MAAM,mBAAmB,GAC5B,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAGX,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAG7D,KAAK,iBAAiB,CAAC,UAAU,SAAS,MAAM,IAAI;KAClD,GAAG,IAAI,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,MAAM,GAC1E,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,GACzD,GAAG,GAAG,EAAE;CACX,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;AAGxC,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAC;AAGxD,MAAM,WAAW,mBAAmB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAC/B;AAGD,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAC/B;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,wBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBA+3BW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../src/locales/en-US.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBA+1BW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"es-ES.d.ts","sourceRoot":"","sources":["../../src/locales/es-ES.ts"],"names":[],"mappings":"AA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
- LocaleSwitcher Example Component
3
-
4
- This is a reference implementation showing how to create a locale switcher
5
- in your application. You can copy and adapt this for your needs.
6
-
7
- Usage:
8
-
9
- <script>
10
- import LocaleSwitcher from '@pie-qti/i18n/components/LocaleSwitcher.svelte';
11
- import { createI18n } from '@pie-qti/i18n';
12
-
13
- let locale = $state('en-US');
14
- const i18n = $derived(createI18n(locale));
15
-
16
- function handleLocaleChange(newLocale) {
17
- locale = newLocale;
18
- }
19
- </script>
20
-
21
- <LocaleSwitcher currentLocale={locale} onChange={handleLocaleChange} {i18n} />
22
- -->
23
-
24
- <script lang="ts">
25
- import type { I18nProvider } from '../core/types';
26
-
27
- interface Props {
28
- /** Currently selected locale code */
29
- currentLocale: string;
30
- /** Callback when locale changes */
31
- onChange: (locale: string) => void;
32
- /** I18n provider for translating the component UI (optional) */
33
- i18n?: I18nProvider;
34
- /** Supported locales (defaults to all available locales) */
35
- availableLocales?: Array<{ code: string; label: string }>;
36
- /** Label text (can be overridden) */
37
- label?: string;
38
- /** Compact mode - no label, just dropdown */
39
- compact?: boolean;
40
- }
41
-
42
- let {
43
- currentLocale,
44
- onChange,
45
- i18n,
46
- availableLocales = DEFAULT_LOCALES,
47
- label,
48
- compact = false,
49
- }: Props = $props();
50
-
51
- // Default list of supported locales
52
- // Note: Some locales may not have full translations yet
53
- const DEFAULT_LOCALES = [
54
- // Currently supported with translations
55
- { code: 'en-US', label: 'English (US)' },
56
- { code: 'es-ES', label: 'Español' },
57
- { code: 'fr-FR', label: 'Français' },
58
- { code: 'nl-NL', label: 'Nederlands' },
59
- { code: 'ro-RO', label: 'Română' },
60
- { code: 'th-TH', label: 'ไทย' },
61
- ];
62
-
63
- // Reactive translations
64
- const translations = $derived({
65
- selectLanguage: label ?? i18n?.t('i18n.selectLanguage') ?? 'Language',
66
- ariaLabel: i18n?.t('i18n.selectLanguageAriaLabel') ?? 'Select display language',
67
- });
68
-
69
- function handleChange(event: Event) {
70
- const select = event.target as HTMLSelectElement;
71
- onChange(select.value);
72
- }
73
- </script>
74
-
75
- <div class="locale-switcher" class:compact>
76
- {#if !compact}
77
- <label for="locale-select" class="locale-label">
78
- {translations.selectLanguage}:
79
- </label>
80
- {/if}
81
-
82
- <select
83
- id="locale-select"
84
- class="locale-select"
85
- value={currentLocale}
86
- onchange={handleChange}
87
- aria-label={translations.ariaLabel}
88
- >
89
- {#each availableLocales as { code, label }}
90
- <option value={code}>{label}</option>
91
- {/each}
92
- </select>
93
- </div>
94
-
95
- <style>
96
- .locale-switcher {
97
- display: flex;
98
- align-items: center;
99
- gap: 0.5rem;
100
- }
101
-
102
- .locale-switcher.compact {
103
- gap: 0;
104
- }
105
-
106
- .locale-label {
107
- font-size: 0.875rem;
108
- font-weight: 500;
109
- color: var(--color-base-content, oklch(20% 0 0));
110
- }
111
-
112
- .locale-select {
113
- padding: 0.375rem 0.75rem;
114
- border: 1px solid var(--color-base-300, oklch(90% 0 0));
115
- border-radius: 0.375rem;
116
- background: var(--color-base-100, oklch(100% 0 0));
117
- color: var(--color-base-content, oklch(20% 0 0));
118
- font-size: 0.875rem;
119
- cursor: pointer;
120
- transition: all 0.15s ease;
121
- }
122
-
123
- .locale-select:hover {
124
- border-color: var(--color-primary, oklch(45% 0.24 277));
125
- }
126
-
127
- .locale-select:focus {
128
- outline: 2px solid var(--color-primary, oklch(45% 0.24 277));
129
- outline-offset: 2px;
130
- border-color: var(--color-primary, oklch(45% 0.24 277));
131
- }
132
-
133
- .locale-select:disabled {
134
- opacity: 0.5;
135
- cursor: not-allowed;
136
- }
137
-
138
- /* Support for DaisyUI if available */
139
- :global(.theme-dark) .locale-select,
140
- :global([data-theme='dark']) .locale-select {
141
- background: var(--color-base-200, oklch(20% 0 0));
142
- border-color: var(--color-base-300, oklch(30% 0 0));
143
- color: var(--color-base-content, oklch(90% 0 0));
144
- }
145
- </style>
@@ -1,224 +0,0 @@
1
- # Example Components
2
-
3
- This directory contains example/reference components demonstrating i18n patterns in PIE-QTI.
4
-
5
- ## LocaleSwitcher
6
-
7
- A reference implementation of a locale switcher component. You can use this directly or copy and customize it for your needs.
8
-
9
- ### Features
10
-
11
- - Dropdown selector for changing display language
12
- - Internationalized labels and aria-labels
13
- - Compact mode (dropdown only, no label)
14
- - Customizable available locales
15
- - Keyboard accessible
16
- - Supports DaisyUI theming
17
-
18
- ### Basic Usage
19
-
20
- ```svelte
21
- <script>
22
- import { LocaleSwitcher, createSvelteI18nProvider } from '@pie-qti/i18n';
23
-
24
- let locale = $state('en-US');
25
- const i18nProvider = $derived(createSvelteI18nProvider(locale));
26
-
27
- function handleLocaleChange(newLocale) {
28
- locale = newLocale;
29
- }
30
- </script>
31
-
32
- <LocaleSwitcher
33
- currentLocale={locale}
34
- onChange={handleLocaleChange}
35
- i18n={i18nProvider}
36
- />
37
- ```
38
-
39
- ### Props
40
-
41
- | Prop | Type | Required | Default | Description |
42
- |------|------|----------|---------|-------------|
43
- | `currentLocale` | `string` | Yes | - | Currently selected locale code (e.g., 'en-US') |
44
- | `onChange` | `(locale: string) => void` | Yes | - | Callback when locale changes |
45
- | `i18n` | `I18nProvider` | No | undefined | I18n provider for translating component UI |
46
- | `availableLocales` | `Array<{code: string, label: string}>` | No | See below | List of locales to show in dropdown |
47
- | `label` | `string` | No | Translated 'Language' | Override label text |
48
- | `compact` | `boolean` | No | `false` | Hide label, show only dropdown |
49
-
50
- ### Default Available Locales
51
-
52
- By default, LocaleSwitcher shows the locales that have translations in PIE-QTI:
53
-
54
- - `en-US` - English (US)
55
- - `es-ES` - Español
56
- - `fr-FR` - Français
57
- - `nl-NL` - Nederlands
58
- - `ro-RO` - Română
59
- - `th-TH` - ไทย
60
-
61
- ### Customizing Available Locales
62
-
63
- You can provide your own list of locales:
64
-
65
- ```svelte
66
- <script>
67
- const myLocales = [
68
- { code: 'en-US', label: 'English' },
69
- { code: 'es-ES', label: 'Spanish' },
70
- { code: 'fr-FR', label: 'French' },
71
- ];
72
- </script>
73
-
74
- <LocaleSwitcher
75
- currentLocale={locale}
76
- onChange={handleLocaleChange}
77
- availableLocales={myLocales}
78
- />
79
- ```
80
-
81
- ### Compact Mode
82
-
83
- Use compact mode when you want the dropdown without a label (e.g., in a toolbar):
84
-
85
- ```svelte
86
- <LocaleSwitcher
87
- currentLocale={locale}
88
- onChange={handleLocaleChange}
89
- i18n={i18nProvider}
90
- compact={true}
91
- />
92
- ```
93
-
94
- ### Custom Label
95
-
96
- Override the default "Language" label:
97
-
98
- ```svelte
99
- <LocaleSwitcher
100
- currentLocale={locale}
101
- onChange={handleLocaleChange}
102
- label="Choose Language"
103
- />
104
- ```
105
-
106
- ### Complete Example with Assessment Player
107
-
108
- ```svelte
109
- <script lang="ts">
110
- import { AssessmentShell } from '@pie-qti/assessment-player';
111
- import { LocaleSwitcher, createSvelteI18nProvider } from '@pie-qti/i18n';
112
-
113
- interface Props {
114
- assessmentData: AssessmentData;
115
- }
116
-
117
- let { assessmentData }: Props = $props();
118
-
119
- // Locale state
120
- let locale = $state('en-US');
121
- const i18nProvider = $derived(createSvelteI18nProvider(locale));
122
-
123
- function handleLocaleChange(newLocale: string) {
124
- locale = newLocale;
125
- // Optionally save to localStorage
126
- localStorage.setItem('preferredLocale', newLocale);
127
- }
128
-
129
- // Restore saved locale on mount
130
- $effect(() => {
131
- const saved = localStorage.getItem('preferredLocale');
132
- if (saved) {
133
- locale = saved;
134
- }
135
- });
136
- </script>
137
-
138
- <div class="app-header">
139
- <h1>My Assessment</h1>
140
- <LocaleSwitcher
141
- currentLocale={locale}
142
- onChange={handleLocaleChange}
143
- i18n={i18nProvider}
144
- compact={true}
145
- />
146
- </div>
147
-
148
- <AssessmentShell
149
- assessment={assessmentData}
150
- i18n={i18nProvider}
151
- />
152
-
153
- <style>
154
- .app-header {
155
- display: flex;
156
- justify-content: space-between;
157
- align-items: center;
158
- padding: 1rem;
159
- border-bottom: 1px solid #e5e5e5;
160
- }
161
- </style>
162
- ```
163
-
164
- ### Styling
165
-
166
- The component uses CSS custom properties for theming:
167
-
168
- ```css
169
- /* Override colors */
170
- :root {
171
- --color-base-100: #ffffff; /* Background */
172
- --color-base-200: #f5f5f5; /* Alt background */
173
- --color-base-300: #e5e5e5; /* Border */
174
- --color-base-content: #000000; /* Text */
175
- --color-primary: #3b82f6; /* Primary accent */
176
- }
177
-
178
- /* Dark mode */
179
- [data-theme='dark'] {
180
- --color-base-100: #1f2937;
181
- --color-base-200: #111827;
182
- --color-base-300: #374151;
183
- --color-base-content: #f9fafb;
184
- --color-primary: #60a5fa;
185
- }
186
- ```
187
-
188
- Or use the `part` attribute for Shadow DOM styling:
189
-
190
- ```css
191
- /* Style the select element */
192
- pie-locale-switcher::part(select) {
193
- border-radius: 8px;
194
- font-size: 16px;
195
- }
196
- ```
197
-
198
- ### Accessibility
199
-
200
- The component follows WCAG 2.2 Level AA guidelines:
201
-
202
- - Properly labeled with `<label for="...">` association
203
- - Includes `aria-label` on the select for screen readers
204
- - Keyboard navigable (arrow keys, Enter to select)
205
- - Focus visible with outline
206
- - Sufficient color contrast (>4.5:1)
207
-
208
- ### Copying and Customizing
209
-
210
- This is a reference implementation - feel free to copy and modify:
211
-
212
- 1. Copy [LocaleSwitcher.svelte](./LocaleSwitcher.svelte) to your project
213
- 2. Customize the styling, props, or behavior
214
- 3. Add features like:
215
- - Flag icons for each locale
216
- - Search/filter for many locales
217
- - Automatic locale detection from browser
218
- - Two-letter language codes display
219
-
220
- ### Related Documentation
221
-
222
- - [INTEGRATION_GUIDE.md](../../docs/INTEGRATION_GUIDE.md) - How to add i18n to components
223
- - [COMPONENT_PATTERNS.md](../../docs/COMPONENT_PATTERNS.md) - UI patterns and examples
224
- - [MIGRATION.md](../../docs/MIGRATION.md) - Migrating existing components to i18n