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

    rbb42dfb r834bcc3  
    11/**
    2  * Admin: Cirkel-beheer (god-only).
    3  *   GET  /admin/circle           -> lijst van cirkel-links + status
    4  *   POST /admin/circle/add       -> Klonkt-URL toevoegen
     2 * Admin: Circle management (god-only).
     3 *   GET  /admin/circle           -> list of circle links + status
     4 *   POST /admin/circle/add       -> add a Klonkt URL
    55 *   POST /admin/circle/:id/remove
    6  *   POST /admin/circle/:id/sync  -> nu verversen (pull + verifieer)
    7  *   POST /admin/circle/allow     -> toggle "mag in cirkels van anderen verschijnen"
     6 *   POST /admin/circle/:id/sync  -> refresh now (pull + verify)
     7 *   POST /admin/circle/allow     -> toggle "may appear in others' circles"
    88 *
    9  * Zie docs/cirkels-v1-spec.md §5d.
     9 * See docs/cirkels-v1-spec.md §5d.
    1010 */
    1111
     
    5151  const site = primarySite();
    5252  if (!site) return res.redirect('/admin/circle?error=' + encodeURIComponent('Geen site gevonden'));
    53   // Schema automatisch aanvullen: een kale domeinnaam → https://, een getypte
    54   // http:// → https:// (federatie is bewust https-only, getekende feeds). Zo hoeft
    55   // de gebruiker nooit zelf http(s):// te typen.
     53  // Auto-complete the scheme: a bare domain name → https://, a typed
     54  // http:// → https:// (federation is intentionally https-only, signed feeds). So the
     55  // user never has to type http(s):// themselves.
    5656  let url = (req.body.remote_url || '').toString().trim().replace(/\/+$/, '');
    5757  if (url && !/^[a-z]+:\/\//i.test(url)) url = 'https://' + url;
     
    6868    return res.redirect('/admin/circle?error=' + encodeURIComponent('Deze site staat al in je cirkel'));
    6969  }
    70   // Meteen ophalen i.p.v. wachten op de 15-min-loop.
     70  // Fetch immediately instead of waiting for the 15-minute loop.
    7171  try {
    7272    const link = db.prepare('SELECT * FROM circle_links WHERE id = ?').get(id);
     
    7575  } catch (e) {
    7676    const msg = String((e && e.message) || e);
    77     // 404 = geen cirkel-endpoint. Hubs federeren bewust NIET (hun /.klonkt/actor.json
    78     // geeft 404), net als losse niet-Klonkt-sites. Niet toevoegen: rol de insert terug
    79     // zodat er geen dode "fout"-rij in de cirkel blijft staan.
     77    // 404 = no circle endpoint. Hubs intentionally do NOT federate (their /.klonkt/actor.json
     78    // returns 404), same as standalone non-Klonkt sites. Don't add: roll back the insert
     79    // so no dead "error" row is left in the circle.
    8080    if (/\b404\b/.test(msg)) {
    8181      db.prepare('DELETE FROM circle_links WHERE id = ?').run(id);
    8282      return res.redirect('/admin/circle?error=' + encodeURIComponent('Niet toegevoegd: deze site doet niet mee aan cirkels. Een hub kan geen cirkel-partner zijn (en losse/niet-Klonkt-sites ook niet).'));
    8383    }
    84     // Andere (mogelijk tijdelijke) fout → link blijft staan; later "Verversen".
     84    // Other (possibly temporary) error → link stays; use "Refresh" later to retry.
    8585    return res.redirect('/admin/circle?success=' + encodeURIComponent('Toegevoegd — synchroniseren mislukte (klik "Verversen" om opnieuw te proberen)'));
    8686  }
     
    9191  if (link) {
    9292    db.prepare('DELETE FROM circle_links WHERE id = ?').run(link.id);
    93     // Gecachte content opruimen als geen andere link nog naar deze actor wijst.
     93    // Clean up cached content if no other link still points to this actor.
    9494    if (link.remote_actor_id) {
    9595      const other = db.prepare('SELECT 1 FROM circle_links WHERE remote_actor_id = ? LIMIT 1').get(link.remote_actor_id);
     
    117117});
    118118
    119 // Alles in één keer verversen (handig "voor de zekerheid").
     119// Refresh everything at once (handy "just to be sure").
    120120router.post('/sync-all', requireGod, async (req, res) => {
    121121  try {
Note: See TracChangeset for help on using the changeset viewer.