Architecture: How to structure bilingual legal documents (Privacy Policy, ...

Documentation for Sessions

🏗️ Architecture: How to structure bilingual legal documents (Privacy Policy, ...

Date: 2026-02-18
Time: 19:42:41 UTC
Session: gspace1-119.4
Agent: angular
Confidence: 93%
Status: ✅ Documented


📋 Decision Context

Question:

How to structure bilingual legal documents (Privacy Policy, Terms of Use) in the NX monorepo?

Task: Create NX library for bilingual legal documents


🎯 Decision Made

Chosen:

Self-contained NX library at libs/libs-structural/legal-lib with signal-based language switching, document registry pattern, and static HTML content in @if blocks

Options Considered:


💭 Reasoning

Key design decisions: (1) LEGAL_DOCUMENTS registry constant — extensible array of document metadata + section definitions, adding new docs requires: add to array + create component + add route. (2) Signal-based language: signal('en') with @if (language() === 'en') / @if (language() === 'es') template blocks — content is STATIC in the HTML, not dynamically loaded. This is critical for prerendering: when the HTML is rendered at build time, the English content is present in the DOM. (3) Self-contained SCSS with CSS custom properties — no external theme dependency, print media queries included. (4) URL query param ?lang=es for shareable links. (5) Shared layout components (language-toggle, table-of-contents, legal-layout) for DRY across all legal pages. (6) AI-specific legal sections covering OpenAI/Anthropic/Google provider disclosure, model training opt-out, autonomous agent terms (Vitto), automated decision-making (CCPA/CPRA).


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation