Add EN/UK/PL translations to pricing.php
All pricing page content now flows through dbnToolsT() with 65 new keys added to i18n.php for all four languages (no/en/uk/pl). A language switcher pill bar is added at the top of the page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+123
-94
@@ -16,83 +16,99 @@ $status = (string)($_GET['status'] ?? '');
|
||||
$loginUrl = 'https://dobetternorge.no/tools-login.php?return=' . urlencode('/pricing.php');
|
||||
$surveyUrl = 'https://dobetternorge.no/survey.php';
|
||||
|
||||
function pt(string $key, string $lang): string {
|
||||
return htmlspecialchars(dbnToolsT($key, $lang));
|
||||
}
|
||||
|
||||
$tierNames = [
|
||||
'free' => $uiLang === 'no' ? 'Gratis' : ($uiLang === 'uk' ? 'Безкоштовно' : ($uiLang === 'pl' ? 'Bezpłatnie' : 'Free')),
|
||||
'light' => 'Light',
|
||||
'pro' => 'Pro',
|
||||
'pro_plus' => $uiLang === 'no' ? 'Pro+ Familie' : ($uiLang === 'uk' ? 'Pro+ Сім\'я' : ($uiLang === 'pl' ? 'Pro+ Rodzina' : 'Pro+ Family')),
|
||||
];
|
||||
|
||||
$tiers = [
|
||||
[
|
||||
'sku' => 'free',
|
||||
'name' => 'Gratis',
|
||||
'price' => '€0',
|
||||
'period' => 'alltid',
|
||||
'credits' => '30 kreditter / måned',
|
||||
'storage' => 'Ingen sak-lagring',
|
||||
'seats' => '1 plass',
|
||||
'cap' => '10 verktøy/time',
|
||||
'sku' => 'free',
|
||||
'name' => $tierNames['free'],
|
||||
'price' => '€0',
|
||||
'period' => dbnToolsT('pricing_period_always', $uiLang),
|
||||
'credits' => '30 ' . dbnToolsT('pricing_credits_mo', $uiLang),
|
||||
'storage' => dbnToolsT('pricing_no_storage', $uiLang),
|
||||
'seats' => dbnToolsT('pricing_seat_1', $uiLang),
|
||||
'cap' => '10 ' . dbnToolsT('pricing_cap_suffix', $uiLang),
|
||||
'features' => [
|
||||
'Tilgang til alle 13 verktøy',
|
||||
'Spørsmål, søk, redaksjon',
|
||||
'Korrespondanse-utkast',
|
||||
dbnToolsT('pricing_free_f1', $uiLang),
|
||||
dbnToolsT('pricing_free_f2', $uiLang),
|
||||
dbnToolsT('pricing_free_f3', $uiLang),
|
||||
],
|
||||
'cta' => $isAuthed ? null : 'Logg inn for å starte',
|
||||
'cta' => $isAuthed ? null : dbnToolsT('pricing_cta_login', $uiLang),
|
||||
'highlight' => false,
|
||||
],
|
||||
[
|
||||
'sku' => 'light',
|
||||
'name' => 'Light',
|
||||
'price' => '€9',
|
||||
'period' => '/ måned',
|
||||
'credits' => '120 kreditter / måned',
|
||||
'storage' => '100 MB sak-lagring',
|
||||
'seats' => '1 plass',
|
||||
'cap' => '15 verktøy/time',
|
||||
'sku' => 'light',
|
||||
'name' => $tierNames['light'],
|
||||
'price' => '€9',
|
||||
'period' => dbnToolsT('pricing_period_mo', $uiLang),
|
||||
'credits' => '120 ' . dbnToolsT('pricing_credits_mo', $uiLang),
|
||||
'storage' => '100 MB',
|
||||
'seats' => dbnToolsT('pricing_seat_1', $uiLang),
|
||||
'cap' => '15 ' . dbnToolsT('pricing_cap_suffix', $uiLang),
|
||||
'features' => [
|
||||
'Alt i Gratis',
|
||||
'Bygg din egen sak (Min Sak)',
|
||||
'Privat dokument-RAG i alle verktøy',
|
||||
'OCR på opplastede PDF-er',
|
||||
dbnToolsT('pricing_light_f1', $uiLang),
|
||||
dbnToolsT('pricing_light_f2', $uiLang),
|
||||
dbnToolsT('pricing_light_f3', $uiLang),
|
||||
dbnToolsT('pricing_light_f4', $uiLang),
|
||||
],
|
||||
'highlight' => false,
|
||||
],
|
||||
[
|
||||
'sku' => 'pro',
|
||||
'name' => 'Pro',
|
||||
'price' => '€29',
|
||||
'period' => '/ måned',
|
||||
'credits' => '500 kreditter / måned',
|
||||
'storage' => '1 GB sak-lagring',
|
||||
'seats' => '1 plass',
|
||||
'cap' => '30 verktøy/time',
|
||||
'sku' => 'pro',
|
||||
'name' => $tierNames['pro'],
|
||||
'price' => '€29',
|
||||
'period' => dbnToolsT('pricing_period_mo', $uiLang),
|
||||
'credits' => '500 ' . dbnToolsT('pricing_credits_mo', $uiLang),
|
||||
'storage' => '1 GB',
|
||||
'seats' => dbnToolsT('pricing_seat_1', $uiLang),
|
||||
'cap' => '30 ' . dbnToolsT('pricing_cap_suffix', $uiLang),
|
||||
'features' => [
|
||||
'Alt i Light',
|
||||
'Hybrid søk (BM25 + vektor) i din sak',
|
||||
'Prioritert kø ved opplasting',
|
||||
'Tidslinje-rapport på saken din',
|
||||
dbnToolsT('pricing_pro_f1', $uiLang),
|
||||
dbnToolsT('pricing_pro_f2', $uiLang),
|
||||
dbnToolsT('pricing_pro_f3', $uiLang),
|
||||
dbnToolsT('pricing_pro_f4', $uiLang),
|
||||
],
|
||||
'highlight' => true,
|
||||
'badge' => 'Mest populær',
|
||||
'badge' => dbnToolsT('pricing_badge_popular', $uiLang),
|
||||
],
|
||||
[
|
||||
'sku' => 'pro_plus',
|
||||
'name' => 'Pro+ Familie',
|
||||
'price' => '€79',
|
||||
'period' => '/ måned',
|
||||
'credits' => 'Ubegrenset',
|
||||
'storage' => '10 GB sak-lagring',
|
||||
'seats' => '3 plasser (familie)',
|
||||
'cap' => '50 verktøy/time per plass',
|
||||
'sku' => 'pro_plus',
|
||||
'name' => $tierNames['pro_plus'],
|
||||
'price' => '€79',
|
||||
'period' => dbnToolsT('pricing_period_mo', $uiLang),
|
||||
'credits' => dbnToolsT('pricing_unlimited', $uiLang),
|
||||
'storage' => '10 GB',
|
||||
'seats' => dbnToolsT('pricing_seats_family', $uiLang),
|
||||
'cap' => '50 ' . dbnToolsT('pricing_cap_per_seat', $uiLang),
|
||||
'features' => [
|
||||
'Alt i Pro',
|
||||
'Inviter 2 familiemedlemmer eller advokat',
|
||||
'Delt sak-arkiv med revisjonslogg',
|
||||
'Ubegrensede saksrapporter',
|
||||
dbnToolsT('pricing_proplus_f1', $uiLang),
|
||||
dbnToolsT('pricing_proplus_f2', $uiLang),
|
||||
dbnToolsT('pricing_proplus_f3', $uiLang),
|
||||
dbnToolsT('pricing_proplus_f4', $uiLang),
|
||||
],
|
||||
'highlight' => false,
|
||||
'badge' => 'For familier',
|
||||
'badge' => dbnToolsT('pricing_badge_family', $uiLang),
|
||||
],
|
||||
];
|
||||
|
||||
$topupNotes = [
|
||||
'topup_s' => dbnToolsT('pricing_topup_s_note', $uiLang),
|
||||
'topup_m' => dbnToolsT('pricing_topup_m_note', $uiLang),
|
||||
'topup_l' => dbnToolsT('pricing_topup_l_note', $uiLang),
|
||||
];
|
||||
$topups = [
|
||||
['sku' => 'topup_s', 'price' => '€5', 'credits' => 30, 'note' => 'Impulskjøp'],
|
||||
['sku' => 'topup_m', 'price' => '€15', 'credits' => 100, 'note' => 'Beste verdi'],
|
||||
['sku' => 'topup_l', 'price' => '€40', 'credits' => 300, 'note' => 'Tunge brukere'],
|
||||
['sku' => 'topup_s', 'price' => '€5', 'credits' => 30, 'note' => $topupNotes['topup_s']],
|
||||
['sku' => 'topup_m', 'price' => '€15', 'credits' => 100, 'note' => $topupNotes['topup_m']],
|
||||
['sku' => 'topup_l', 'price' => '€40', 'credits' => 300, 'note' => $topupNotes['topup_l']],
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
@@ -100,8 +116,8 @@ $topups = [
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Priser — Do Better Norge verktøy</title>
|
||||
<meta name="description" content="Priser for tools.dobetternorge.no: gratis tier, abonnementer og kreditt-topp-opp. Bygg din egen sak med privat RAG.">
|
||||
<title><?= pt('pricing_title_meta', $uiLang) ?></title>
|
||||
<meta name="description" content="<?= pt('pricing_desc_meta', $uiLang) ?>">
|
||||
<link rel="canonical" href="https://tools.dobetternorge.no/pricing.php">
|
||||
<meta name="theme-color" content="#00205B">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
@@ -153,33 +169,42 @@ $topups = [
|
||||
.status-pill-info { display: inline-block; margin-bottom: 1.5rem; padding: 6px 12px; background: #fef3c7; color: #92400e; border-radius: 6px; font-size: 0.9rem; }
|
||||
.status-pill-success { background: #d1fae5; color: #065f46; }
|
||||
.status-pill-error { background: #fee2e2; color: #991b1b; }
|
||||
.lang-bar { text-align: right; margin-bottom: 1rem; font-size: 0.85rem; }
|
||||
.lang-bar a { margin-left: 0.5rem; color: #6b7280; text-decoration: none; padding: 2px 6px; border-radius: 4px; }
|
||||
.lang-bar a.is-active { background: #00205B; color: #fff; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="pricing-shell">
|
||||
<div class="lang-bar">
|
||||
<?php foreach (['no', 'en', 'uk', 'pl'] as $lc): ?>
|
||||
<a href="?lang=<?= $lc ?>" class="<?= $lc === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($lc)) ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<header class="pricing-hero">
|
||||
<p style="margin:0 0 0.5rem; text-transform:uppercase; letter-spacing:0.08em; color:#6b7280; font-size:0.85rem;">Do Better Norge — verktøy</p>
|
||||
<h1>Bygg din egen sak. Bruk hele verktøyboksen.</h1>
|
||||
<p>13 AI-verktøy for barnevernssaker. Last opp dine egne dokumenter, og la verktøyene jobbe på din private sak — ikke bare generisk lov.</p>
|
||||
<p style="margin:0 0 0.5rem; text-transform:uppercase; letter-spacing:0.08em; color:#6b7280; font-size:0.85rem;"><?= pt('pricing_eyebrow', $uiLang) ?></p>
|
||||
<h1><?= pt('pricing_hero_title', $uiLang) ?></h1>
|
||||
<p><?= pt('pricing_hero_sub', $uiLang) ?></p>
|
||||
</header>
|
||||
|
||||
<?php if ($status === 'success'): ?>
|
||||
<p class="status-pill-info status-pill-success">Takk! Din betaling er bekreftet. Det kan ta noen sekunder før kontoen oppdateres.</p>
|
||||
<p class="status-pill-info status-pill-success"><?= pt('pricing_status_success', $uiLang) ?></p>
|
||||
<?php elseif ($status === 'canceled'): ?>
|
||||
<p class="status-pill-info">Kassen ble avbrutt. Du kan prøve igjen når som helst.</p>
|
||||
<p class="status-pill-info"><?= pt('pricing_status_canceled', $uiLang) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($isAuthed && !$surveyDone): ?>
|
||||
<div class="survey-banner">
|
||||
<div class="copy">
|
||||
<h3>Tjen 25 ekstra kreditter</h3>
|
||||
<p>Svar på 5 korte spørsmål om hva som hjelper deg mest. Ingen salgspitch — bare research som hjelper oss å forbedre verktøyene.</p>
|
||||
<h3><?= pt('pricing_survey_title', $uiLang) ?></h3>
|
||||
<p><?= pt('pricing_survey_text', $uiLang) ?></p>
|
||||
</div>
|
||||
<a href="<?= htmlspecialchars($surveyUrl) ?>">Ta undersøkelsen</a>
|
||||
<a href="<?= htmlspecialchars($surveyUrl) ?>"><?= pt('pricing_survey_cta', $uiLang) ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="pricing-grid" aria-label="Abonnementer">
|
||||
<section class="pricing-grid" aria-label="<?= pt('pricing_faq_title', $uiLang) ?>">
|
||||
<?php foreach ($tiers as $tier): ?>
|
||||
<article class="pricing-card<?= !empty($tier['highlight']) ? ' is-highlight' : '' ?>">
|
||||
<?php if (!empty($tier['badge'])): ?>
|
||||
@@ -203,20 +228,20 @@ $topups = [
|
||||
</ul>
|
||||
<?php if ($tier['sku'] === 'free'): ?>
|
||||
<?php if (!$isAuthed): ?>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>"><?= htmlspecialchars($tier['cta'] ?? 'Logg inn') ?></a>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>"><?= htmlspecialchars($tier['cta'] ?? dbnToolsT('pricing_cta_login', $uiLang)) ?></a>
|
||||
<?php elseif ($currentTier === 'free'): ?>
|
||||
<span class="pricing-cta current">Din nåværende plan</span>
|
||||
<span class="pricing-cta current"><?= pt('pricing_cta_current', $uiLang) ?></span>
|
||||
<?php else: ?>
|
||||
<span class="pricing-cta secondary">Tilgjengelig</span>
|
||||
<span class="pricing-cta secondary"><?= pt('pricing_cta_available', $uiLang) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php if (!$isAuthed): ?>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>">Logg inn for å abonnere</a>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>"><?= pt('pricing_cta_subscribe', $uiLang) ?></a>
|
||||
<?php elseif ($currentTier === $tier['sku']): ?>
|
||||
<span class="pricing-cta current">Din nåværende plan</span>
|
||||
<span class="pricing-cta current"><?= pt('pricing_cta_current', $uiLang) ?></span>
|
||||
<?php else: ?>
|
||||
<button type="button" class="pricing-cta primary" data-sku="<?= htmlspecialchars($tier['sku']) ?>" data-checkout="subscription">
|
||||
Velg <?= htmlspecialchars($tier['name']) ?>
|
||||
<?= pt('pricing_cta_choose', $uiLang) ?> <?= htmlspecialchars($tier['name']) ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
@@ -224,63 +249,67 @@ $topups = [
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
|
||||
<section class="pricing-topups" aria-label="Engangskjøp">
|
||||
<h2>Topp opp kreditter</h2>
|
||||
<p class="lead">Trenger du flere kreditter denne måneden? Kjøp en engangspakke — de utløper aldri.</p>
|
||||
<section class="pricing-topups" aria-label="<?= pt('pricing_topup_title', $uiLang) ?>">
|
||||
<h2><?= pt('pricing_topup_title', $uiLang) ?></h2>
|
||||
<p class="lead"><?= pt('pricing_topup_lead', $uiLang) ?></p>
|
||||
<div class="topup-grid">
|
||||
<?php foreach ($topups as $topup): ?>
|
||||
<div class="topup-card">
|
||||
<div class="price"><?= htmlspecialchars($topup['price']) ?></div>
|
||||
<div class="credits"><?= (int)$topup['credits'] ?> kreditter</div>
|
||||
<div class="credits"><?= (int)$topup['credits'] ?> <?= pt('pricing_credits_label', $uiLang) ?></div>
|
||||
<div class="note"><?= htmlspecialchars($topup['note']) ?></div>
|
||||
<?php if ($isAuthed): ?>
|
||||
<button type="button" class="pricing-cta primary" data-sku="<?= htmlspecialchars($topup['sku']) ?>" data-checkout="topup">Kjøp</button>
|
||||
<button type="button" class="pricing-cta primary" data-sku="<?= htmlspecialchars($topup['sku']) ?>" data-checkout="topup"><?= pt('pricing_topup_buy', $uiLang) ?></button>
|
||||
<?php else: ?>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>">Logg inn først</a>
|
||||
<a class="pricing-cta primary" href="<?= htmlspecialchars($loginUrl) ?>"><?= pt('pricing_login_first', $uiLang) ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="pricing-faq" aria-label="Ofte stilte spørsmål">
|
||||
<h2 style="font-family:'Crimson Pro', serif; margin-bottom:1rem;">Ofte stilte spørsmål</h2>
|
||||
<section class="pricing-faq" aria-label="<?= pt('pricing_faq_title', $uiLang) ?>">
|
||||
<h2 style="font-family:'Crimson Pro', serif; margin-bottom:1rem;"><?= pt('pricing_faq_title', $uiLang) ?></h2>
|
||||
<details>
|
||||
<summary>Hva er forskjellen mellom månedlige kreditter og bonuskreditter?</summary>
|
||||
<p>Månedlige kreditter (fra abonnement eller gratis tier) tilbakestilles første hver måned. Bonuskreditter (fra undersøkelsen eller topp-opp) utløper aldri og brukes etter de månedlige er oppbrukt.</p>
|
||||
<summary><?= pt('pricing_faq1_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq1_a', $uiLang) ?></p>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Hva er Min Sak?</summary>
|
||||
<p>Min Sak er din private dokumentbank. Last opp PDF-er fra saken din, så blir de OCR-ert, analysert og lagret i din egen sikre korpus. Alle verktøyene kan deretter referere til dine egne dokumenter i stedet for bare generisk lov.</p>
|
||||
<summary><?= pt('pricing_faq2_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq2_a', $uiLang) ?></p>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Hvor er dataene mine lagret?</summary>
|
||||
<p>Alt innenfor EU: servere i Falkenstein (Tyskland) og Helsinki (Finland), AI-tjenester i Vest-Europa og Norge Øst. Vi er hostet hos Hetzner og bruker Microsoft Azure for AI. Stripe behandler betalinger gjennom Irland.</p>
|
||||
<summary><?= pt('pricing_faq3_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq3_a', $uiLang) ?></p>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Kan jeg dele en konto med advokaten min?</summary>
|
||||
<p>Ja — Pro+ Familie inkluderer 3 plasser. Du kan invitere advokat, samboer eller en annen familiemedlem. Alle ser de samme dokumentene, men hvem som gjorde hva blir logget.</p>
|
||||
<summary><?= pt('pricing_faq4_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq4_a', $uiLang) ?></p>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Hva skjer hvis jeg sier opp?</summary>
|
||||
<p>Du faller tilbake til gratis-tier. Bonuskredittene dine beholdes. Dokumentene i Min Sak oppbevares i 90 dager før de slettes — så du har tid til å eksportere dem eller fornye.</p>
|
||||
<summary><?= pt('pricing_faq5_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq5_a', $uiLang) ?></p>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Tilbyr dere refusjon?</summary>
|
||||
<p>Ja, full refusjon innen 7 dager hvis du ikke er fornøyd. Send oss en e-post.</p>
|
||||
<summary><?= pt('pricing_faq6_q', $uiLang) ?></summary>
|
||||
<p><?= pt('pricing_faq6_a', $uiLang) ?></p>
|
||||
</details>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
const connecting = <?= json_encode(dbnToolsT('pricing_connecting', $uiLang)) ?>;
|
||||
const errorRetry = <?= json_encode(dbnToolsT('pricing_error_retry', $uiLang)) ?>;
|
||||
const errorMsg = <?= json_encode(dbnToolsT('pricing_error_checkout', $uiLang)) ?>;
|
||||
|
||||
const buttons = document.querySelectorAll('button[data-checkout]');
|
||||
buttons.forEach(btn => {
|
||||
btn.addEventListener('click', async () => {
|
||||
const sku = btn.getAttribute('data-sku');
|
||||
btn.disabled = true;
|
||||
const original = btn.textContent;
|
||||
btn.textContent = 'Kobler til...';
|
||||
btn.textContent = connecting;
|
||||
try {
|
||||
const res = await fetch('/api/stripe-checkout.php', {
|
||||
method: 'POST',
|
||||
@@ -291,12 +320,12 @@ $topups = [
|
||||
if (data.ok && data.url) {
|
||||
window.location.href = data.url;
|
||||
} else {
|
||||
btn.textContent = 'Feil — prøv igjen';
|
||||
alert(data.error?.message || 'Kunne ikke starte kassen.');
|
||||
btn.textContent = errorRetry;
|
||||
alert(data.error?.message || errorMsg);
|
||||
}
|
||||
} catch (e) {
|
||||
btn.textContent = original;
|
||||
alert('Nettverksfeil: ' + e.message);
|
||||
alert(e.message);
|
||||
} finally {
|
||||
setTimeout(() => { btn.disabled = false; btn.textContent = original; }, 1500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user