Changeset 834bcc3 in Klonkt for src/middleware/site.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/middleware/site.js

    rbb42dfb r834bcc3  
    1515
    1616/**
    17  * De primaire/hoofd-site — ÉÉN bron van waarheid (vervangt de "oudste site ="
    18  * hoofd"-aanname die voorheen los in resolveSite/hub/account/admin stond).
    19  * Leest de expliciete is_primary-vlag; valt terug op de oudste als die (nog)
    20  * nergens staat, zodat bestaand gedrag exact behouden blijft.
     17 * The primary/main site — ONE source of truth (replaces the "oldest site ="
     18 * main" assumption that was previously scattered across resolveSite/hub/account/admin).
     19 * Reads the explicit is_primary flag; falls back to the oldest if it isn't set
     20 * anywhere yet, so existing behaviour is preserved exactly.
    2121 */
    2222export function getPrimarySite() {
     
    2828export function resolveSite(req, res, next) {
    2929  const tenancy = getTenancy();
    30   res.locals.tenancy = tenancy; // ook beschikbaar voor views
     30  res.locals.tenancy = tenancy; // also available in views
    3131
    32   // In HUB-mode mapt /user/:slug naar een specifieke site. In SOLO-mode bestaat
    33   // er maar één site: we slaan die routing over en pinnen op de primaire site.
     32  // In HUB mode /user/:slug maps to a specific site. In SOLO mode there is only
     33  // one site: we skip that routing and pin to the primary site.
    3434  if (tenancy === 'hub') {
    35     // Een Klonkt-site is canoniek bereikbaar via /user/:slug. /sites/:slug is een
    36     // legacy-alias → 301 naar de canonieke vorm zodat er één URL-schema overblijft
    37     // (behoudt pad + querystring; raakt /admin/sites NIET, dat begint met /admin/).
     35    // A Klonkt site is canonically reachable via /user/:slug. /sites/:slug is a
     36    // legacy alias → 301 to the canonical form so one URL scheme remains
     37    // (preserves path + query string; does NOT touch /admin/sites, which starts with /admin/).
    3838    const m = req.path.match(/^\/(sites|user)\/([a-zA-Z0-9_-]+)(\/.*)?$/);
    3939    if (m) {
     
    4949      }
    5050    }
    51     // (Verwijderd: een dode "slug == hostname"-subdomein-hack. Slugs mogen geen
    52     // punten bevatten, dus die kon nooit matchen. Echte subdomein-routing zou de
    53     // subdomein-LABEL tegen de slug matchen — een aparte feature, niet dit.)
     51    // (Removed: a dead "slug == hostname" subdomain hack. Slugs may not contain
     52    // dots, so it could never match. Real subdomain routing would match the
     53    // subdomain LABEL against the slug — a separate feature, not this.)
    5454  }
    5555
    56   // Solo (of hub zonder match): pin op de primaire/hoofd-site.
     56  // Solo (or hub without a match): pin to the primary/main site.
    5757  const defaultSite = getPrimarySite();
    5858  if (defaultSite) {
     
    7979
    8080  try {
    81     // m.filename = de kale bestandsnaam; de speelbare URL is de gated stream-route
    82     // (audioUrl). De media-tabel heeft GEEN url-kolom — de oude query selecteerde
    83     // m.url en faalde dus altijd stil (lege speler). Nu bouwen we de URL uit filename.
     81    // m.filename = the bare filename; the playable URL is the gated stream route
     82    // (audioUrl). The media table has NO url column — the old query selected
     83    // m.url and always failed silently (empty player). Now we build the URL from filename.
    8484    const rows = db.prepare(`
    8585      SELECT t.id, t.title, t.artist, t.duration, t.position, m.filename
Note: See TracChangeset for help on using the changeset viewer.