21c092e0d0a5a2e5d0c9b83afa0d119e5d1c562e
The tool now respects the chosen UI language end-to-end — even if the source document is Norwegian, a user on EN/UK/PL gets the analysis in their language. Norwegian statute references (barnevernsloven § 4-25, EMK Art. 8) and case names (Strand Lobben mot Norge 37283/13) are kept verbatim because they are proper nouns. LLM (LegalAnalysisAgent.php): - extractIssues: prompt asks for question + brief_context in user's language; statute refs preserved - answerIssue: Norwegian core system prompt (keeps fine-tune precision) + language-coercion line for non-NO; localised context/source labels - synthesise: overall_assessment, next_steps, disclaimer in user's language; explicit per-language disclaimer text - runFullAnalysis empty-case fallback also localised - what_to_check translated per language UI: - 40 new la_* translation keys in i18n.php × 4 languages (NO/EN/UK/PL) - legal-analysis.php: 4-way lang switcher, dbnToolsT() for every label, emits window.DBN_LA_I18N for runtime JS strings - legal-analysis.js: t() helper reads from window.DBN_LA_I18N - layout_footer.php: emits window.DBN_CURRENT_LANG + window.DBN_ADDON_I18N so the legal-analysis add-on button works in the page's language no matter which tool it's invoked from - tools.js add-on: reads from DBN_ADDON_I18N, passes DBN_CURRENT_LANG to /api/legal-analysis.php so server responds in same language Co-Authored-By: Claude Sonnet 4.6 <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%