Changeset 03fa548 in Klonkt for src/views/partials/topnav.ejs


Ignore:
Timestamp:
06/20/2026 01:39:41 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
91c0a39
Parents:
d0f4c10
Message:

feat(i18n): interface language NL/EN/DE with visitor switcher (phase 1: chrome)

  • i18n.js (t helper + nl/en/de dictionary + resolveLang: session → browser → nl).
  • render.js passes t/lang/langs to all views; /lang/:code sets the language in the session.
  • Language switcher (select) in the footer; chrome translated: topnav (Archive/Login/Account/Admin/Logout/…), pill (Agenda/Solo/Circle/Timeline/Grid), post nav (Newer/Older), footer.
  • Content (posts/site name/bio) stays in the author's language. Admin + deeper page strings follow in a next phase.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/topnav.ejs

    rd0f4c10 r03fa548  
    2626    <div class="masthead-brand">
    2727      <% if (_isAdmin) { %>
    28         <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin">← Terug naar site</a>
     28        <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin"><%= t('nav.back_to_site') %></a>
    2929      <% } else if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
    3030        <%# Hub: de brand gaat naar de hub-home via HTMX. De chrome wordt in hub-modus
     
    6464           hx-indicator="#pcms-loading">
    6565          <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5" rx="1"/><line x1="10" y1="12" x2="14" y2="12"/></svg>
    66           <span class="nav-label">Archief</span>
     66          <span class="nav-label"><%= t('nav.archive') %></span>
    6767        </a>
    6868      <% } %>
     
    118118                 hx-push-url="/account" hx-indicator="#pcms-loading">
    119119                <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
    120                 <span>Account</span>
     120                <span><%= t('nav.account') %></span>
    121121              </a>
    122122              <a href="/favorieten" role="menuitem" class="udi"
     
    124124                 hx-push-url="/favorieten" hx-indicator="#pcms-loading">
    125125                <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>
    126                 <span>Favorieten</span>
     126                <span><%= t('nav.favorites') %></span>
    127127              </a>
    128128              <% if (typeof canSeeBeheer !== 'undefined' && canSeeBeheer) { %>
     
    131131                   hx-push-url="/admin" hx-indicator="#pcms-loading">
    132132                  <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h7v7H3z"/><path d="M14 3h7v7h-7z"/><path d="M14 14h7v7h-7z"/><path d="M3 14h7v7H3z"/></svg>
    133                   <span>Beheer</span>
     133                  <span><%= t('nav.admin') %></span>
    134134                </a>
    135135              <% } %>
     
    139139                   hx-push-url="<%= _siteUrlBase %>/posts/new" hx-indicator="#pcms-loading">
    140140                  <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
    141                   <span>Nieuwe post</span>
     141                  <span><%= t('nav.new_post') %></span>
    142142                </a>
    143143              <% } %>
     
    147147              <a href="/auth/logout" role="menuitem" class="udi udi-danger">
    148148                <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
    149                 <span>Uitloggen</span>
     149                <span><%= t('nav.logout') %></span>
    150150              </a>
    151151            </div>
     
    156156           hx-get="/auth/login?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
    157157           hx-push-url="/auth/login" hx-indicator="#pcms-loading">
    158           <span class="nav-label">Inloggen</span>
     158          <span class="nav-label"><%= t('nav.login') %></span>
    159159        </a>
    160160      <% } %>
Note: See TracChangeset for help on using the changeset viewer.