Skip to content

feat(i18n): runtime ES/EN + translate the landing (3.6) - #74

Merged
santidev21 merged 1 commit into
mainfrom
feat/i18n-infra-landing
Oct 6, 2026
Merged

santidev21 merged 1 commit into
mainfrom
feat/i18n-infra-landing

Conversation

@santidev21

Copy link
Copy Markdown
Owner

What

Item 3.6 i18n. The UI was hardcoded Spanish. Adds a runtime, dependency-free i18n layer:

  • I18nService: flat key → string dictionaries (es/en), a lang signal (default + fallback Spanish), t(key, params) with {param} interpolation, and setLanguage() persisted to localStorage (bikontrol.lang) + <html lang>.
  • TranslatePipe ({{ 'key' | t }}), impure on purpose so it re-renders when the language changes.
  • LanguageSwitcherComponent (ES/EN) in the landing header.
  • Landing fully translated as the first surface (ES + EN).

Scope (incremental)

The app is large, so coverage is delivered surface by surface. Done: landing. Follow-ups: auth pages, app shell (nav), dashboard pages (home/summary/maintenance/statistics/profile) and the legal/help long-form text. Two safety properties while incomplete:

  • a missing key falls back to Spanish, then to the key itself — nothing renders blank;
  • English is opt-in at runtime, so ES remains the default everywhere.

Verification

  • Frontend: 216 tests pass (+6 i18n service, +1 landing runtime-switch), coverage 77.5% lines.
  • format:check + lint clean; AOT build passes.
  • No backend/contract changes. E2E unaffected (default ES; no new spec, keeps the dev DB clean).

The UI was hardcoded Spanish. Add a minimal, dependency-free i18n layer so a
language can be chosen at runtime:

- I18nService: flat key dictionaries (es/en), a lang signal (default and
  fallback Spanish), t(key, params) with {param} interpolation, and
  setLanguage() persisted to localStorage + <html lang>.
- TranslatePipe ({{ 'key' | t }}), impure on purpose to re-render on change.
- LanguageSwitcherComponent (ES/EN) in the landing header.
- Landing fully translated as the first surface.

Coverage is incremental: auth, shell and dashboard pages follow in later PRs;
missing keys fall back to Spanish (then the key), so nothing renders blank.
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@santidev21
santidev21 merged commit 9a00084 into main Oct 6, 2026
14 checks passed
@santidev21
santidev21 deleted the feat/i18n-infra-landing branch October 6, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant