mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +02:00
fix(guides/web): add missing supportedLocales export to i18n
The layout imported supportedLocales but it was never exported from the i18n module, breaking the build. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
82abde6cd5
commit
071d2178ea
1 changed files with 4 additions and 1 deletions
|
|
@ -3,6 +3,9 @@ import { addMessages, init, getLocaleFromNavigator } from 'svelte-i18n';
|
|||
import de from './locales/de.json';
|
||||
import en from './locales/en.json';
|
||||
|
||||
export const supportedLocales = ['de', 'en'] as const;
|
||||
export type SupportedLocale = (typeof supportedLocales)[number];
|
||||
|
||||
const LOCALE_KEY = 'guides_locale';
|
||||
|
||||
addMessages('de', de);
|
||||
|
|
@ -16,7 +19,7 @@ init({
|
|||
initialLocale: locale.startsWith('de') ? 'de' : 'en',
|
||||
});
|
||||
|
||||
export function setLocale(lang: 'de' | 'en') {
|
||||
export function setLocale(lang: SupportedLocale) {
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
localStorage.setItem(LOCALE_KEY, lang);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue