mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 08:21:11 +00:00
cfffb4bdd7
ci/woodpecker/push/build-arm Pipeline failed
- Rewrite SettingsPage to 5-panel v2 layout: Tenant, Directories,
Aircrafts, Language, Session — corner-bracket panels, sticky footer
pinned to viewport bottom (Cancel + Save Changes), live dirty-state
indicator.
- Wire try/catch/finally + role="alert" in save handler so AZ-477's
three it.fails contract tests flip to passing; remove the obsolete
v1-drift control test and its unhandledRejection harness.
- Add EN/UA language toggle; persist to localStorage('azaion.lang')
and read on i18n init. Export LANG_STORAGE_KEY from src/i18n.
- Add Add-Aircraft flow (reuses admin Modal) and view-only star
default toggle.
- Extend the v2 design system with .btn-danger-ghost, .star,
.path-wrap/.browse classes. Scope settings.html-spec button
proportions (padding 7px 14px, weight 400, letter-spacing 0.10em,
line-height 1.5) under .settings-page so the admin spec is unaffected.
- Restore module-scoped bootstrapInflight declaration in
src/auth/AuthContext.tsx (deleted in 2a62415 while references
remained — every test using tests/setup.ts was throwing
ReferenceError).
26 lines
698 B
TypeScript
26 lines
698 B
TypeScript
import i18n from 'i18next'
|
|
import { initReactI18next } from 'react-i18next'
|
|
import en from './en.json'
|
|
import ua from './ua.json'
|
|
|
|
export const LANG_STORAGE_KEY = 'azaion.lang'
|
|
|
|
function readPersistedLanguage(): 'en' | 'ua' {
|
|
// Safari private mode throws on localStorage access — fall back to 'en'.
|
|
try {
|
|
const persisted = localStorage.getItem(LANG_STORAGE_KEY)
|
|
return persisted === 'ua' || persisted === 'en' ? persisted : 'en'
|
|
} catch {
|
|
return 'en'
|
|
}
|
|
}
|
|
|
|
i18n.use(initReactI18next).init({
|
|
resources: { en: { translation: en }, ua: { translation: ua } },
|
|
lng: readPersistedLanguage(),
|
|
fallbackLng: 'en',
|
|
interpolation: { escapeValue: false },
|
|
})
|
|
|
|
export default i18n
|