Changeset 834bcc3 in Klonkt for src/routes/account.js


Ignore:
Timestamp:
06/23/2026 06:14:27 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
d774679
Parents:
bb42dfb
Message:

i18n: translate Dutch code comments to English across src/

Comments in routes/services/views/config/middleware/assets translated to
English for the public repo. A few dev-facing throw/console message strings
were Englished too. No user-facing UI strings or i18n dictionary values changed
(src/services/i18n.js untouched). Logic unchanged.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/account.js

    rbb42dfb r834bcc3  
    6666  const hasPassword = !!(account && account.password_hash && account.password_hash !== '!google-oauth');
    6767  const googleLinked = !!(account && account.google_sub);
    68   if (account) { delete account.password_hash; delete account.google_sub; } // niet naar de view lekken
     68  if (account) { delete account.password_hash; delete account.google_sub; } // don't leak to the view
    6969
    7070  renderPage(req, res, 'pages/account', {
     
    8181});
    8282
    83 // ==================== PERSOONLIJKE INTERFACE-TAAL ====================
    84 // Slaat de taalkeuze op het account op (reist mee over apparaten/sessies) én
    85 // zet 'm meteen in de sessie zodat 't direct effect heeft.
     83// ==================== PERSONAL INTERFACE LANGUAGE ====================
     84// Saves the language choice on the account (persists across devices/sessions) and
     85// also sets it in the session immediately so it takes effect right away.
    8686router.post('/lang', requireAuth, (req, res) => {
    8787  const code = SUPPORTED.includes(req.body.lang) ? req.body.lang : null;
     
    9494});
    9595
    96 // De site die deze gebruiker mag bewerken vanuit z'n account: z'n eigen site
    97 // (owner_id), of voor een god de primaire site. Null als er niets is.
     96// The site this user may edit from their account: their own site
     97// (owner_id), or for a god the primary site. Null if nothing found.
    9898function ownedSite(user) {
    9999  if (!user) return null;
    100100  let site = db.prepare('SELECT id, title, tagline, slug, owner_id FROM sites WHERE owner_id = ? ORDER BY created_at LIMIT 1').get(user.id);
    101101  if (!site && user.role === 'god') {
    102     site = getPrimarySite(); // primaire/hoofd-site als fallback
     102    site = getPrimarySite(); // primary/main site as fallback
    103103  }
    104104  return site || null;
     
    124124  const bio = (req.body.bio || '').toString().slice(0, 500).trim();
    125125
    126   // E-mail (optioneel mee te wijzigen). Validatie: geldig formaat + niet al door
    127   // een ander account in gebruik. E-mail is het login-/reset-anker, dus uniek.
     126  // Email (optionally also changed). Validation: valid format + not already in use
     127  // by another account. Email is the login/reset anchor, so it must be unique.
    128128  const email = (req.body.email || '').toString().trim();
    129129  if (email) {
     
    138138    db.prepare('UPDATE users SET email = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?')
    139139      .run(email, req.session.user.id);
    140     req.session.user.email = email; // sessie bijwerken zodat de UI klopt
     140    req.session.user.email = email; // update session so the UI reflects the change
    141141  }
    142142
     
    166166
    167167  const row = db.prepare('SELECT password_hash FROM users WHERE id = ?').get(req.session.user.id);
    168   // Google-only accounts (luisteraars) hebben geen echt wachtwoord.
     168  // Google-only accounts (listeners) have no real password.
    169169  if (!row || !row.password_hash || row.password_hash === '!google-oauth') {
    170170    return res.redirect('/account?error=' + encodeURIComponent('Dit account heeft geen wachtwoord (Google-login)'));
     
    181181});
    182182
    183 // Google-account ontkoppelen. Alleen toegestaan als er nog een wachtwoord is,
    184 // anders zou je jezelf buitensluiten (geen login-methode meer over).
     183// Unlink Google account. Only allowed if a password is set,
     184// otherwise the user would lock themselves out (no login method left).
    185185router.post('/google/unlink', requireAuth, (req, res) => {
    186186  const row = db.prepare('SELECT password_hash, google_sub FROM users WHERE id = ?').get(req.session.user.id);
Note: See TracChangeset for help on using the changeset viewer.