feat: Legal Tools v1 — multilingual landing, dashboard, SSO bridge
- Public landing page at / for unauthenticated users (EN/NO/UK/PL) - Authenticated / shows Case Workbench dashboard with manifesto strip, stats, and launched-tool grid (Transcribe, Timeline, BVJ, Advocate, Deep Research, Corpus) - Added includes/i18n.php with full 4-language translation layer - Extended layout.php to Case Workbench shell with tool rail, lang switcher - AI output language normalization extended to en/no/uk/pl in PHP agents - SSO token validation in bootstrap.php / index.php (dobetternorge.no bridge) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -107,6 +107,7 @@ function dbnToolsStartSession(): void
|
||||
}
|
||||
|
||||
dbnToolsStartSession();
|
||||
require_once __DIR__ . '/i18n.php';
|
||||
|
||||
function dbnToolsIsAuthenticated(): bool
|
||||
{
|
||||
@@ -224,8 +225,7 @@ function dbnToolsJsonInput(int $maxBytes = 50000): array
|
||||
|
||||
function dbnToolsNormalizeLanguage(mixed $value): string
|
||||
{
|
||||
$language = strtolower(trim((string)$value));
|
||||
return in_array($language, ['no', 'en'], true) ? $language : 'en';
|
||||
return dbnToolsNormalizeUiLanguage($value);
|
||||
}
|
||||
|
||||
function dbnToolsNormalizeRegion(mixed $value): string
|
||||
@@ -472,10 +472,13 @@ function dbnToolsHasActiveSubscription(int $clientId, int $packageId, ?PDO $db =
|
||||
|
||||
function dbnToolsDisclaimer(string $language): string
|
||||
{
|
||||
if ($language === 'no') {
|
||||
return 'Juridisk informasjon og forberedelsesstøtte, ikke endelig juridisk rådgivning.';
|
||||
}
|
||||
return 'Legal information and preparation support, not final legal advice.';
|
||||
$language = dbnToolsNormalizeUiLanguage($language);
|
||||
return match ($language) {
|
||||
'no' => 'Juridisk informasjon og forberedelsesstøtte, ikke endelig juridisk rådgivning.',
|
||||
'uk' => 'Юридична інформація та підтримка підготовки, не остаточна юридична порада.',
|
||||
'pl' => 'Informacje prawne i wsparcie przygotowania, nie ostateczna porada prawna.',
|
||||
default => 'Legal information and preparation support, not final legal advice.',
|
||||
};
|
||||
}
|
||||
|
||||
function dbnToolsExcerpt(string $text, int $limit = 520): string
|
||||
|
||||
Reference in New Issue
Block a user