tractatus/src/routes
TheFlow 8c22811110 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
..
admin.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
analytics.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
audit.routes.js feat: enhance framework services and format architectural documentation 2025-10-11 00:50:47 +13:00
auth.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
blog.routes.js feat(blog): integrate Tractatus framework governance into blog publishing 2025-10-25 08:47:31 +13:00
calendar.routes.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
cases.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
contact.routes.js feat(crm): implement unified contact form system 2025-10-24 16:56:21 +13:00
crm.routes.js feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
demo.routes.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
documents.routes.js feat(docs): intelligent section recategorization + i18n infrastructure 2025-10-26 00:48:27 +13:00
governance.routes.js feat(infra): semantic versioning and systemd service implementation 2025-10-09 09:16:22 +13:00
hooks-metrics.routes.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
inbox.routes.js feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
index.js feat(crm): complete Phase 3 multi-project CRM + critical bug fixes 2025-10-24 18:10:14 +13:00
koha.routes.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
media.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
newsletter.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
projects.routes.js feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
publications.routes.js fix(submissions): extract data from API response wrappers 2025-10-24 16:35:10 +13:00
relationships.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00
rules.routes.js feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
submissions.routes.js feat(translation): complete DeepL translation workflow 2025-10-24 11:22:50 +13:00
sync-health.routes.js refactor(lint): fix code style and unused variables across src/ 2025-10-24 20:15:26 +13:00
test.routes.js fix(submissions): restructure Economist package and fix article display 2025-10-24 08:47:42 +13:00