Wire language switcher into Settings; add E2E UAT suite
- App.svelte: language toggle (EN/BM) wired to existing i18n.js store, header tagline reflects selection. Was previously dead code with no UI control (found by e2e-uat.cjs during full-flow UAT). - e2e-uat.cjs: Playwright-driven E2E UAT against the live deployment — real clicks/typing through all 7 tabs, faraid textbook-case verification, heir-exclusion blocking, marad al-mawt guard, 1/3 cap override flow, claim issuance/transfer, export/delete-all guards, PWA and console-error checks.
This commit is contained in:
+20
-1
@@ -6,6 +6,10 @@
|
||||
import FamilyWaqfDesignator from './lib/FamilyWaqfDesignator.svelte';
|
||||
import DigitalClaims from './lib/horizon2/DigitalClaims.svelte';
|
||||
import { exportAll, deleteAll } from './lib/storage.js';
|
||||
import { lang, setLang } from './lib/i18n.js';
|
||||
|
||||
let currentLang = $state('en');
|
||||
lang.subscribe(v => currentLang = v);
|
||||
|
||||
const tabs = ['Faraid', 'Assets', 'Wassiyah', 'Hibah', 'Family Waqf', 'Claims (H2)', 'Settings'];
|
||||
const icons = ['📊', '📁', '📜', '🎁', '⛲', '🔗', '⚙️'];
|
||||
@@ -41,7 +45,7 @@
|
||||
<div class="brand-line brand-line-first">Nur</div>
|
||||
<div class="brand-line brand-line-second">Falah</div>
|
||||
</div>
|
||||
<span class="header-tagline">ESTATE & WAQF SUITE</span>
|
||||
<span class="header-tagline">{currentLang === 'ms' ? 'RANGKAIAN HARTA & WAKAF' : 'ESTATE & WAQF SUITE'}</span>
|
||||
<div class="header-divider"></div>
|
||||
</header>
|
||||
|
||||
@@ -65,6 +69,15 @@
|
||||
<div class="module">
|
||||
<h2>Settings</h2>
|
||||
<p class="sub">Your data is stored locally on this device. Nothing is sent to a third party.</p>
|
||||
|
||||
<div class="lang-switch">
|
||||
<span class="lang-label">Language / Bahasa</span>
|
||||
<div class="lang-buttons">
|
||||
<button class="lang-btn" class:active={currentLang === 'en'} onclick={() => setLang('en')}>English</button>
|
||||
<button class="lang-btn" class:active={currentLang === 'ms'} onclick={() => setLang('ms')}>Bahasa Malaysia</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn-secondary" onclick={doExport}>Export all data (JSON)</button>
|
||||
<button class="btn-danger" onclick={doDelete}>Delete all data — irreversible</button>
|
||||
</div>
|
||||
@@ -112,4 +125,10 @@
|
||||
|
||||
:global(.btn-danger) { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); color: #EF4444; font-weight: 600; cursor: pointer; margin-top: 12px; }
|
||||
:global(.btn-secondary) { width: 100%; padding: 12px; border-radius: 8px; border: none; background: rgba(255,255,255,0.08); color: #E8E4DC; font-weight: 600; cursor: pointer; }
|
||||
|
||||
.lang-switch { margin-bottom: 16px; }
|
||||
.lang-label { display: block; font-size: 12px; color: #B8B2A6; margin-bottom: 8px; }
|
||||
.lang-buttons { display: flex; gap: 8px; }
|
||||
.lang-btn { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid rgba(201,168,76,0.2); background: rgba(255,255,255,0.05); color: #8A8478; font-size: 13px; cursor: pointer; }
|
||||
.lang-btn.active { background: rgba(201,168,76,0.15); color: #C9A84C; border-color: rgba(201,168,76,0.4); font-weight: 600; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user