tractatus/public
TheFlow 5e969bd4da feat(docs): intelligent section recategorization + i18n infrastructure
This commit includes two major improvements to the documentation system:

## 1. Section Recategorization (UX Fix)

**Problem**: 64 sections (24%) were incorrectly marked as "critical" and
displayed at the bottom of documents, burying important foundational content.

**Solution**:
- Created intelligent recategorization script analyzing titles, excerpts,
  and document context
- Reduced "critical" from 64 → 2 sections (97% reduction)
- Properly categorized content by purpose:
  - Conceptual: 63 → 138 (+119%) - foundations, "why this matters"
  - Practical: 3 → 46 (+1433%) - how-to guides, examples
  - Technical: 111 → 50 (-55%) - true implementation details

**UI Improvements**:
- Reordered category display: Critical → Conceptual → Practical → Technical → Reference
- Changed Critical color from amber to red for better visual distinction
- All 22 documents recategorized (173 sections updated)

## 2. i18n Infrastructure (Phase 2)

**Backend**:
- DeepL API integration service with quota management and error handling
- Translation API routes (GET /api/documents/:slug?lang=de, POST /api/documents/:id/translate)
- Document model already supports translations field (no schema changes)

**Frontend**:
- docs-app.js enhanced with language detection and URL parameter support
- Automatic fallback to English when translation unavailable
- Integration with existing i18n-simple.js system

**Scripts**:
- translate-all-documents.js: Batch translation workflow (dry-run support)
- audit-section-categories.js: Category distribution analysis

**URL Strategy**: Query parameter approach (?lang=de, ?lang=fr)

**Status**: Backend complete, ready for DeepL API key configuration

**Files Modified**:
- Frontend: document-cards.js, docs-app.js
- Backend: documents.controller.js, documents.routes.js, DeepL.service.js
- Scripts: 3 new governance/i18n scripts

**Database**: 173 sections recategorized via script (already applied)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 00:48:27 +13:00
..
.well-known fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
about fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
admin fix(audit): fix timeline chart rendering with pixel heights and count labels 2025-10-25 12:22:55 +13:00
css fix(css): correct justify-center syntax error in loading overlay 2025-10-24 12:41:53 +13:00
demos fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
docs fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
downloads fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
fonts fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
images docs: complete research documentation publication (Phases 1-6) 2025-10-25 20:10:04 +13:00
js feat(docs): intelligent section recategorization + i18n infrastructure 2025-10-26 00:48:27 +13:00
koha feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
locales fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
about.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
api-reference.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
architecture.html fix(cache): update architecture.html cache version for interactive diagram 2025-10-24 18:28:42 +13:00
blog-post.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
blog.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
case-submission.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
check-version.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
docs-viewer.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
docs.html fix(security): secure archived documents endpoint and reorganize docs UI 2025-10-26 00:03:13 +13:00
faq.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
favicon-new.svg fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
favicon.ico fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
favicon.svg fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
implementer.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
implementer.html.backup fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
index.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
koha.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
leader.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
manifest.json fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
media-inquiry.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
media-triage-transparency.html fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
privacy.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
researcher.html chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00
service-worker.js fix(security): secure archived documents endpoint and reorganize docs UI 2025-10-26 00:03:13 +13:00
test-pressure-chart.html fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
version.json chore: bump cache version for deployment 2025-10-25 21:41:24 +13:00