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

    rbb42dfb r834bcc3  
    11/**
    2  * GET /search?q=...          -> volledige resultatenpagina
    3  * GET /search/suggest?q=...  -> compacte JSON voor live resultaten in de overlay
     2 * GET /search?q=...          -> full results page
     3 * GET /search/suggest?q=...  -> compact JSON for live results in the overlay
    44 *
    5  * Doorzoekt de huidige site op:
     5 * Searches the current site across:
    66 *   1. Posts via posts_fts (FTS5, prefix-matching) — published only.
    7  *   2. Nummers (audio_tracks) op titel / artiest / album.
    8  *   3. Evenementen (shows) op plaats / locatie / land / notitie — als de agenda aan staat.
    9  *   4. Pagina's (Agenda / Downloads / Links / Perskit / Archief) op naam — alleen
    10  *      de beschikbare.
     7 *   2. Tracks (audio_tracks) on title / artist / album.
     8 *   3. Events (shows) on city / venue / country / notes — when the agenda is enabled.
     9 *   4. Pages (Agenda / Downloads / Links / Press kit / Archive) by name — only
     10 *      the available ones.
    1111 *
    12  * FTS5: user-input wordt getokeniseerd op niet-letter/cijfer en elk token tussen
    13  * dubbele quotes + `*` gezet → prefix-match, geen operator-soup/syntax-errors.
     12 * FTS5: user input is tokenised on non-letter/digit chars and each token is wrapped
     13 * in double quotes + `*` → prefix-match, no operator-soup/syntax-errors.
    1414 */
    1515
     
    4747}
    4848
    49 // ── De kern: alle bronnen doorzoeken voor één site. `lim` begrenst per groep
    50 //    (klein voor de live-suggesties, ruim voor de volle pagina). ──────────────
     49// ── Core: search all sources for one site. `lim` caps results per group
     50//    (small for live suggestions, large for the full page). ──────────────────
    5151function searchSite(req, res, rawQ, lim) {
    5252  const site = res.locals.site;
     
    7979  }
    8080
    81   // 2. Nummers
     81  // 2. Tracks
    8282  try {
    8383    const trackRows = db.prepare(`
     
    108108  } catch (err) { if (!out.queryError) out.queryError = err.message; }
    109109
    110   // 3. Evenementen (agenda) — alleen als de agenda publiek aan staat.
     110  // 3. Events (agenda) — only when the agenda is publicly enabled.
    111111  if (premiumUnlocked() && getSetting('agenda_enabled') === '1') {
    112112    try {
     
    125125  }
    126126
    127   // 4. Pagina's — curated, alleen de beschikbare; match op de (vertaalde) naam.
     127  // 4. Pages — curated, available ones only; matched against the (translated) name.
    128128  const ql = rawQ.toLowerCase();
    129129  const candidates = [
     
    143143}
    144144
    145 // ── Volledige resultatenpagina ───────────────────────────────────────────────
     145// ── Full results page ────────────────────────────────────────────────────────
    146146router.get('/', (req, res) => {
    147147  const site = res.locals.site;
     
    165165});
    166166
    167 // ── Live suggesties (JSON) ───────────────────────────────────────────────────
     167// ── Live suggestions (JSON) ──────────────────────────────────────────────────
    168168router.get('/suggest', (req, res) => {
    169169  const site = res.locals.site;
Note: See TracChangeset for help on using the changeset viewer.