Repository navigation
feat: add language switcher persistence to LocalStorage - #589
Merged
dark-sarge merged 1 commit intoOct 26, 2026
Merged
dark-sarge merged 1 commit into
dark-sarge merged 1 commit into
Conversation
- Create storage.ts utility with SSR-safe LocalStorage helpers - Add useLocaleStorage hook for managing locale preferences - Create LocaleInitializer component to restore saved locale on app load - Update LanguageSwitcher to persist selected language - Update root layout to initialize locale on mount Implements arflexx#455: Language preferences now persist across sessions and survive page reloads. Invalid/unsupported values are ignored and fall back to the default locale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements language switcher persistence to LocalStorage, allowing users' selected language preferences to survive across sessions and page reloads.
Closes #455
Changes
frontend/lib/storage.ts— New SSR-safe LocalStorage utility modulesaveLocale()— Persists selected language to LocalStorage underairflex_localekeyloadLocale()— Retrieves saved language preferenceclearLocale()— Clears stored preferencefrontend/hooks/useLocaleStorage.ts— New reusable locale management hookgetSavedLocale()— Returns saved locale or defaults toenif invalid/missingpersistLocale()— Validates and saves a localeresetLocalePreference()— Clears stored locale preferencefrontend/components/LocaleInitializer.tsx— New client component for app-load initializationfrontend/components/LanguageSwitcher.tsx— Updated to persist language selectionsaveLocale()when user selects a new languagefrontend/app/layout.tsx— Updated to initialize locale on app loadLocaleInitializercomponent to root layoutAcceptance Criteria
airflex_localekeyTesting