Changeset 137cca5 in Klonkt


Ignore:
Timestamp:
06/21/2026 11:35:49 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
fe86013
Parents:
bffb348
Message:

feat(i18n phase 3): welcome/first-run, login, register, bottom-tab translated

NL/EN/DE keys + views: welcome.ejs, auth-register.ejs, auth-login.ejs (common
strings; Google error map still NL), bottom-tab.ejs. The most visible visitor
pages of a fresh (German) site are now translated.

Co-Authored-By: Claude <noreply@…>

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/services/i18n.js

    rbffb348 r137cca5  
    6969    'admin.th_slug': 'Slug', 'admin.th_title': 'Titel', 'admin.th_owner': 'Eigenaar', 'admin.th_created': 'Aangemaakt',
    7070    'admin.th_username': 'Gebruikersnaam', 'admin.th_email': 'E-mail', 'admin.th_role': 'Rol', 'admin.th_joined': 'Lid sinds',
     71    // Welkom / first-run
     72    'welcome.title': 'Welkom bij Klonkt',
     73    'welcome.tagline': 'Een zelf-gehost publicatieplatform.',
     74    'welcome.have_account': 'Al een account? Inloggen',
     75    'welcome.note': 'Maak je beheerdersaccount aan om te beginnen — daarna is registratie gesloten.',
     76    'welcome.nosite': 'Hoi {user}! Er is nog geen site ingesteld.',
     77    // Auth (login/register)
     78    'auth.admin_login_title': 'Beheerder inloggen',
     79    'auth.username_or_email': 'Gebruikersnaam of e-mail',
     80    'auth.password': 'Wachtwoord',
     81    'auth.forgot': 'Wachtwoord vergeten?',
     82    'auth.google_btn': 'Inloggen met Google',
     83    'auth.public_sub': 'Log in om te reageren en je favorieten te bewaren.',
     84    'auth.admin_box_q': 'Beheerder?',
     85    'auth.admin_box_sub': 'Log in met gebruikersnaam & wachtwoord',
     86    'auth.google_unavail': 'Inloggen met Google is op deze site nog niet ingesteld.',
     87    'auth.create_admin': 'Beheerder aanmaken',
     88    'auth.reg_intro': 'Eerste keer opzetten — maak je beheerdersaccount aan. Dit kan maar één keer.',
     89    'auth.f_username': 'Gebruikersnaam (3-32 tekens, letters/cijfers/_-)',
     90    'auth.f_email': 'E-mail',
     91    'auth.f_password': 'Wachtwoord (min 8 tekens)',
     92    // Bottom-tab (mobiel)
     93    'tab.home': 'Home', 'tab.search': 'Zoek', 'tab.write': 'Schrijven', 'tab.profile': 'Profiel',
    7194  },
    7295  en: {
     
    126149    'admin.th_slug': 'Slug', 'admin.th_title': 'Title', 'admin.th_owner': 'Owner', 'admin.th_created': 'Created',
    127150    'admin.th_username': 'Username', 'admin.th_email': 'Email', 'admin.th_role': 'Role', 'admin.th_joined': 'Joined',
     151    'welcome.title': 'Welcome to Klonkt',
     152    'welcome.tagline': 'A self-hosted publishing platform.',
     153    'welcome.have_account': 'Already have an account? Log in',
     154    'welcome.note': 'Create your admin account to get started — registration closes after that.',
     155    'welcome.nosite': 'Hi {user}! No site is configured yet.',
     156    'auth.admin_login_title': 'Admin login',
     157    'auth.username_or_email': 'Username or email',
     158    'auth.password': 'Password',
     159    'auth.forgot': 'Forgot password?',
     160    'auth.google_btn': 'Sign in with Google',
     161    'auth.public_sub': 'Log in to comment and save your favorites.',
     162    'auth.admin_box_q': 'Admin?',
     163    'auth.admin_box_sub': 'Log in with username & password',
     164    'auth.google_unavail': 'Google sign-in isn’t set up on this site yet.',
     165    'auth.create_admin': 'Create admin',
     166    'auth.reg_intro': 'First-time setup — create your admin account. This can only be done once.',
     167    'auth.f_username': 'Username (3-32 chars, letters/digits/_-)',
     168    'auth.f_email': 'Email',
     169    'auth.f_password': 'Password (min 8 chars)',
     170    'tab.home': 'Home', 'tab.search': 'Search', 'tab.write': 'Write', 'tab.profile': 'Profile',
    128171  },
    129172  de: {
     
    183226    'admin.th_slug': 'Slug', 'admin.th_title': 'Titel', 'admin.th_owner': 'Eigentümer', 'admin.th_created': 'Erstellt',
    184227    'admin.th_username': 'Benutzername', 'admin.th_email': 'E-Mail', 'admin.th_role': 'Rolle', 'admin.th_joined': 'Mitglied seit',
     228    'welcome.title': 'Willkommen bei Klonkt',
     229    'welcome.tagline': 'Eine selbstgehostete Publishing-Plattform.',
     230    'welcome.have_account': 'Schon ein Konto? Anmelden',
     231    'welcome.note': 'Lege dein Administrator-Konto an, um zu starten — danach ist die Registrierung geschlossen.',
     232    'welcome.nosite': 'Hallo {user}! Es ist noch keine Seite eingerichtet.',
     233    'auth.admin_login_title': 'Administrator-Anmeldung',
     234    'auth.username_or_email': 'Benutzername oder E-Mail',
     235    'auth.password': 'Passwort',
     236    'auth.forgot': 'Passwort vergessen?',
     237    'auth.google_btn': 'Mit Google anmelden',
     238    'auth.public_sub': 'Melde dich an, um zu kommentieren und Favoriten zu speichern.',
     239    'auth.admin_box_q': 'Administrator?',
     240    'auth.admin_box_sub': 'Mit Benutzername & Passwort anmelden',
     241    'auth.google_unavail': 'Google-Anmeldung ist auf dieser Seite noch nicht eingerichtet.',
     242    'auth.create_admin': 'Administrator anlegen',
     243    'auth.reg_intro': 'Ersteinrichtung — lege dein Administrator-Konto an. Das geht nur einmal.',
     244    'auth.f_username': 'Benutzername (3-32 Zeichen, Buchstaben/Ziffern/_-)',
     245    'auth.f_email': 'E-Mail',
     246    'auth.f_password': 'Passwort (min. 8 Zeichen)',
     247    'tab.home': 'Start', 'tab.search': 'Suche', 'tab.write': 'Schreiben', 'tab.profile': 'Profil',
    185248  },
    186249};
  • src/views/pages/auth-login.ejs

    rbffb348 r137cca5  
    77%>
    88<div class="container auth-page">
    9   <h1><%= _admin ? 'Beheerder inloggen' : 'Inloggen' %></h1>
     9  <h1><%= _admin ? t('auth.admin_login_title') : t('nav.login') %></h1>
    1010  <% if (typeof success !== 'undefined' && success) { %><div class="alert alert-success"><%= success %></div><% } %>
    1111  <%
     
    3838      <% } %>
    3939      <label>
    40         <span>Gebruikersnaam of e-mail</span>
     40        <span><%= t('auth.username_or_email') %></span>
    4141        <input type="text" name="username" value="<%= username %>" required autofocus autocomplete="username">
    4242      </label>
    4343      <label>
    44         <span>Wachtwoord</span>
     44        <span><%= t('auth.password') %></span>
    4545        <input type="password" name="password" required autocomplete="current-password">
    4646      </label>
    47       <button type="submit" class="btn btn-primary">Inloggen</button>
    48       <p class="auth-link auth-link-muted"><a href="/auth/reset-request">Wachtwoord vergeten?</a></p>
     47      <button type="submit" class="btn btn-primary"><%= t('nav.login') %></button>
     48      <p class="auth-link auth-link-muted"><a href="/auth/reset-request"><%= t('auth.forgot') %></a></p>
    4949    </form>
    5050  <% } else if (googleReady) { %>
    5151    <%# Publieke login: alleen Google, voor luisteraars/fans. %>
    52     <p class="auth-sub">Log in om te reageren en je favorieten te bewaren.</p>
     52    <p class="auth-sub"><%= t('auth.public_sub') %></p>
    5353    <a class="btn btn-google" href="/auth/google<%= (typeof next !== 'undefined' && next) ? '?next=' + encodeURIComponent(next) : '' %>">
    5454      <svg class="g-icon" width="18" height="18" viewBox="0 0 18 18" aria-hidden="true">
     
    5858        <path fill="#EA4335" d="M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"/>
    5959      </svg>
    60       <span>Inloggen met Google</span>
     60      <span><%= t('auth.google_btn') %></span>
    6161    </a>
    6262  <% } else { %>
    63     <div class="alert">Inloggen met Google is op deze site nog niet ingesteld.</div>
     63    <div class="alert"><%= t('auth.google_unavail') %></div>
    6464  <% } %>
    6565
     
    6969      <span class="auth-admin-box-icon" aria-hidden="true">🔑</span>
    7070      <span class="auth-admin-box-text">
    71         <strong>Beheerder?</strong>
    72         <small>Log in met gebruikersnaam &amp; wachtwoord</small>
     71        <strong><%= t('auth.admin_box_q') %></strong>
     72        <small><%= t('auth.admin_box_sub') %></small>
    7373      </span>
    7474      <span class="auth-admin-box-arrow" aria-hidden="true">&rarr;</span>
  • src/views/pages/auth-register.ejs

    rbffb348 r137cca5  
    11<div class="container auth-page">
    2   <h1>Beheerder aanmaken</h1>
    3   <p class="auth-intro">Eerste keer opzetten — maak je beheerdersaccount aan. Dit kan maar één keer.</p>
     2  <h1><%= t('auth.create_admin') %></h1>
     3  <p class="auth-intro"><%= t('auth.reg_intro') %></p>
    44  <% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
    55  <form method="post" action="/auth/register" class="auth-form">
     
    88    <% } %>
    99    <label>
    10       <span>Gebruikersnaam (3-32 tekens, letters/cijfers/_-)</span>
     10      <span><%= t('auth.f_username') %></span>
    1111      <input type="text" name="username" value="<%= username %>" required autofocus autocomplete="username" pattern="[a-zA-Z0-9_-]{3,32}">
    1212    </label>
    1313    <label>
    14       <span>E-mail</span>
     14      <span><%= t('auth.f_email') %></span>
    1515      <input type="email" name="email" value="<%= email %>" required autocomplete="email">
    1616    </label>
    1717    <label>
    18       <span>Wachtwoord (min 8 tekens)</span>
     18      <span><%= t('auth.f_password') %></span>
    1919      <input type="password" name="password" required minlength="8" autocomplete="new-password">
    2020    </label>
    21     <button type="submit" class="btn btn-primary">Beheerder aanmaken</button>
     21    <button type="submit" class="btn btn-primary"><%= t('auth.create_admin') %></button>
    2222  </form>
    2323</div>
  • src/views/pages/welcome.ejs

    rbffb348 r137cca5  
    11<div class="container welcome-page">
    2   <h1>Welcome to Klonkt</h1>
    3   <p class="welcome-tagline">A self-hosted publishing platform.</p>
    4  
     2  <h1><%= t('welcome.title') %></h1>
     3  <p class="welcome-tagline"><%= t('welcome.tagline') %></p>
     4
    55  <% if (!user) { %>
    66    <div class="welcome-actions">
    7       <a href="/auth/register" class="btn btn-primary">Beheerder aanmaken</a>
    8       <a href="/auth/login" class="btn">Al een account? Inloggen</a>
     7      <a href="/auth/register" class="btn btn-primary"><%= t('auth.create_admin') %></a>
     8      <a href="/auth/login" class="btn"><%= t('welcome.have_account') %></a>
    99    </div>
    10     <p class="welcome-note">Maak je beheerdersaccount aan om te beginnen — daarna is registratie gesloten.</p>
     10    <p class="welcome-note"><%= t('welcome.note') %></p>
    1111  <% } else { %>
    12     <p>Hi <%= user.username %>! No site is configured yet.</p>
     12    <p><%= t('welcome.nosite', { user: user.username }) %></p>
    1313  <% } %>
    1414</div>
  • src/views/partials/bottom-tab.ejs

    rbffb348 r137cca5  
    5252      <polyline points="9 22 9 12 15 12 15 22"/>
    5353    </svg>
    54     <span class="bottom-tab-label">Home</span>
     54    <span class="bottom-tab-label"><%= t('tab.home') %></span>
    5555  </a>
    5656
     
    6262      <line x1="21" y1="21" x2="16.65" y2="16.65"/>
    6363    </svg>
    64     <span class="bottom-tab-label">Zoek</span>
     64    <span class="bottom-tab-label"><%= t('tab.search') %></span>
    6565  </button>
    6666
     
    7676        <line x1="5" y1="12" x2="19" y2="12"/>
    7777      </svg>
    78       <span class="bottom-tab-label">Schrijven</span>
     78      <span class="bottom-tab-label"><%= t('tab.write') %></span>
    7979    </a>
    8080  <% } %>
     
    106106        <span class="bottom-tab-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
    107107      <% } %>
    108       <span class="bottom-tab-label">Profiel</span>
     108      <span class="bottom-tab-label"><%= t('tab.profile') %></span>
    109109    </button>
    110110  <% } else { %>
     
    119119        <line x1="15" y1="12" x2="3" y2="12"/>
    120120      </svg>
    121       <span class="bottom-tab-label">Inloggen</span>
     121      <span class="bottom-tab-label"><%= t('nav.login') %></span>
    122122    </a>
    123123  <% } %>
Note: See TracChangeset for help on using the changeset viewer.