effd3289b4fb6da23b6ec7c1be376face6407d6a
New dedicated tool for translating Norwegian legal documents (Barnevernet letters, court decisions, correspondence) into the user's chosen language with legal-terminology annotations. - translate.php: new tool page with source/target language selectors, 4-way UI lang switcher, file upload, doc picker, streaming results - api/translate.php: NDJSON streaming endpoint; Azure GPT-4o-mini with legal-aware prompt that preserves Norwegian statute refs verbatim and annotates terms with no target-language equivalent; 2-credit cost - assets/js/translate.js: form handler, NDJSON stream reader, copy button - assets/css/tools.css: .lt-* styles for translation result + annotations - includes/i18n.php: 22 lt_* keys × 4 languages; translate entry in nav - includes/FreeTier.php: translate → 2 credits - includes/CaseResults.php + case-result.php: translate in eligible tools, toolLabel, toolIcon, deriveTitle, rendering block, rerun map Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Do Better Norge Legal Tools Hub
MVP docroot for tools.dobetternorge.no.
Required environment
- CaveauAI client access for
DBN_CAVEAU_CLIENT_SLUGandDBN_CAVEAU_PACKAGE_SLUG DBN_AZURE_OPENAI_ENDPOINTDBN_AZURE_OPENAI_API_KEYDBN_AZURE_OPENAI_API_VERSIONDBN_AZURE_OPENAI_CHAT_DEPLOYMENTDBN_AZURE_OPENAI_EMBEDDING_DEPLOYMENT
Optional:
DBN_AI_PORTAL_ROOT(defaults to siblingai-portal)DBN_CAVEAU_CLIENT_SLUG(defaults todobetter)DBN_CAVEAU_PACKAGE_SLUG(defaults tofamily-legal)DBN_TOOLS_SUPPORT_DIRDBN_TOOLS_METADATA_LOG
Authentication
The login form authenticates against Caveau client_users for the configured
client slug. The client must be active, the user must be active, and the client
must have an active subscription to the configured corpus package.
Use scripts/setup-caveau-access.php for repeatable local/production setup of
the Do Better Norge Caveau owner account, family-legal subscription, and
white-label domain mappings. Pass the account password through
DBN_SETUP_PASSWORD at runtime only; do not commit it.
The APIs process pasted text in memory and write only metadata such as tool name, latency, language, source count, chunk count, deployment, and anonymous session id.
Description
Languages
PHP
77.3%
JavaScript
13.6%
CSS
9.1%