/test/aapp

src/arts/aapp

{App.lang.t('app.title')}

{App.lang.t('app.subtitle')}

1. Locale (single source of truth)

App.setLocale(...) propagates to Lang, Format and Frontend through a shared LocaleSource. BCP 47 resolution runs per record on every Lang.t() call.

{#each LOCALES as { code, label, flag } (code)} {/each}

Active: {App.getLocale()}

2. Lang — BCP 47 resolution in action

greeting('{userName}') → {App.lang.t('app.greeting', { name: userName })}

cart({'{count: ' + cartCount + '}'}) → {App.lang.t('app.cart', { count: cartCount })}

Has only es-MX and es-AR — bare 'es' picks the first sibling and emits AMBIGUOUS_SIBLING_MATCH in DEV. Watch the logger table below.

3. Format — locale flows through

Same locale string reaches Intl.NumberFormat and Intl.DateTimeFormat via the shared LocaleSource.

Format.getLocale() {formatsView.locale}
numbers.format({sampleNumber}) {formatsView.number}
currency.format({sampleAmount}) {formatsView.currency}
dates.formatDateTime(...) {formatsView.date}

4. Frontend — direction + theme (with persistence)

dir is auto-derived from the locale (rtl for ar). Theme persists in a cookie via frontend.persist.overrides.theme; mode/density/dir persist in localStorage with the App's namespace. Recargá la página para verificar el round-trip.

Theme: {#each THEMES as t (t)} {/each}
locale{frontendView.locale}
dir{frontendView.dir}
theme{frontendView.theme}
mode{frontendView.mode}
density{frontendView.density}

5. Storage — App.storage + page-scoped entries

App.storage usa localAdapter con namespace test-aapp. El contador se incrementa en cada montaje de la página y persiste entre recargas (mientras no lo borres).

visit-counter {visitCounter.current}
fullKey {visitCounter.fullKey}

Para más adapters, raw mode, TTL, version+migrate y errores, mirá la página dedicada /test/stor.

6. Sium — page-scoped, fed with App's Lang + Logger

Sium is not part of aapp — this page constructs {'createEngineSium({ lang: App.lang, logger: App.Logger })'} locally because validation is page-scoped. Issues stay as {'{ code, params }'} data; switching locale re-translates them without re-validating.

e.preventDefault()}>
{#if loginOk}

✓ Valid input.

{:else if translatedIssues.length > 0} {/if}

7. Logger — shared sink

Lang warnings (missing translations, ambiguous siblings) and Sium debug entries (validation failures) all reach App.Logger. Below are entries captured by a UI transport.

{#if captured.length === 0}

No entries yet.

{:else} {#each captured as entry, i (entry.id)} {/each}
# Level Cat Message Context
{i + 1} {levelName(entry.level)} {entry.category} {entry.message} {#if entry.context} {JSON.stringify(entry.context)} {:else} — {/if}
{/if}