Ignore:
Timestamp:
06/30/2026 12:23:37 AM (2 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
80797d7
Parents:
f882048
Message:

fix(i18n): localize the mobile profile-sheet menu labels

The mobile profile menu had hardcoded Dutch labels (Account, Beheer, Nieuwe post, Thema,
Donker/Licht, Uitloggen) so they didn't translate on EN/DE sites. They now use t().

  • src/views/partials/profile-sheet.ejs — Account/Admin/New post/Logout reuse the existing nav.* keys; the theme item + its JS state label use new nav.theme_label/nav.dark/nav.light
  • src/services/i18n.js — add nav.theme_label, nav.dark, nav.light (nl/en/de)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/profile-sheet.ejs

    rf882048 re954722  
    5252        <a href="/account" class="profile-sheet-item" role="menuitem" data-close-sheet>
    5353          <svg class="psi-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>
    54           <span class="psi-label">Account</span>
     54          <span class="psi-label"><%= t('nav.account') %></span>
    5555          <svg class="psi-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
    5656        </a>
     
    7979        <a href="/admin" class="profile-sheet-item" role="menuitem" data-close-sheet>
    8080          <svg class="psi-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 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z"/></svg>
    81           <span class="psi-label">Beheer</span>
     81          <span class="psi-label"><%= t('nav.admin') %></span>
    8282          <svg class="psi-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
    8383        </a>
     
    9090           hx-push-url="<%= _base %>/posts/new" hx-indicator="#pcms-loading">
    9191          <svg class="psi-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-4L16.5 3.5z"/></svg>
    92           <span class="psi-label">Nieuwe post</span>
     92          <span class="psi-label"><%= t('nav.new_post') %></span>
    9393          <svg class="psi-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
    9494        </a>
     
    104104        <button type="button" class="profile-sheet-item" id="profile-sheet-theme" role="menuitemcheckbox">
    105105          <svg class="psi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
    106           <span class="psi-label">Thema</span>
    107           <span class="psi-meta" id="profile-sheet-theme-state">Donker</span>
     106          <span class="psi-label"><%= t('nav.theme_label') %></span>
     107          <span class="psi-meta" id="profile-sheet-theme-state"><%= t('nav.dark') %></span>
    108108        </button>
    109109      </li>
     
    117117        <a href="/auth/logout" class="profile-sheet-item is-destructive" role="menuitem">
    118118          <svg class="psi-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>
    119           <span class="psi-label">Uitloggen</span>
     119          <span class="psi-label"><%= t('nav.logout') %></span>
    120120        </a>
    121121      </li>
     
    409409    if (!themeLbl) return;
    410410    const t = document.documentElement.getAttribute('data-theme') || 'dark';
    411     themeLbl.textContent = t === 'dark' ? 'Donker' : 'Licht';
     411    themeLbl.textContent = t === 'dark' ? '<%= t('nav.dark') %>' : '<%= t('nav.light') %>';
    412412  }
    413413  if (themeBtn) {
Note: See TracChangeset for help on using the changeset viewer.