From c4d1061fd114ae0f2e50c4f109153afd40e12379 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 4 May 2026 19:28:23 +0000 Subject: [PATCH] Fix hardcoded English strings in admin item-row controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several user-visible strings in public/shared/admin.js bypassed the i18n system and stayed in English regardless of the user's selected locale, also leaking into browser-printed PDFs. The admin-side renderer had drifted from the public-side renderer in public/shared/scripts.js, which already routed the same strings through t(...). Affected: - "View →" link on grid- and list-layout custom-section items. - "Learn More →" link on cards-layout custom-section items. - "Manage Items" button on every custom section. - title tooltips on per-row Toggle Visibility / Edit / Delete / drag-handle controls across Experience, Certifications, Education, Skills, Projects, and custom-section item rows. All call sites now go through t(...). Reused existing keys view_link, learn_more, and action.toggle_visibility; added action.manage_items, action.edit, action.delete, and action.drag_to_reorder to all 8 locale files so key parity (enforced by tests/frontend.test.js) is preserved. Fixes #161 https://claude.ai/code/session_01NTce1xfN8xiRcHWqoZaeV5 --- CHANGELOG.md | 11 ++++++++ package-lock.json | 4 +-- package.json | 2 +- public/shared/admin.js | 52 +++++++++++++++++++------------------- public/shared/i18n/de.json | 4 +++ public/shared/i18n/en.json | 4 +++ public/shared/i18n/es.json | 4 +++ public/shared/i18n/fr.json | 4 +++ public/shared/i18n/it.json | 4 +++ public/shared/i18n/nl.json | 4 +++ public/shared/i18n/pt.json | 4 +++ public/shared/i18n/zh.json | 4 +++ version.json | 2 +- 13 files changed, 73 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c9906..5e6c467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to CV Manager will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/), versioning follows [Semantic Versioning](https://semver.org/). +## [1.49.2] - 2026-05-04 + +### Fixed +- **Missing translations on admin item-row controls and custom-section UI ([#161](https://github.com/vincentmakes/cv-manager/issues/161)).** Several user-visible strings in `public/shared/admin.js` bypassed the i18n system and stayed in English regardless of the user's selected locale — and leaked into browser-printed PDFs. The admin-side renderer had drifted from the public-side renderer in `public/shared/scripts.js`, which already routed the same strings through `t(...)`. All call sites now go through `t(...)`: + - The "View →" link on grid- and list-layout custom-section items (reused existing `view_link` key). + - The "Learn More →" link on cards-layout custom-section items (reused existing `learn_more` key). + - The "Manage Items" button at the bottom of every custom section. + - The `title` tooltips on the per-row action controls — Toggle Visibility (reused existing `action.toggle_visibility` key), Edit, Delete, and the drag handle — across Experience, Certifications, Education, Skills, Projects, and custom-section item rows. + + Added four new keys (`action.manage_items`, `action.edit`, `action.delete`, `action.drag_to_reorder`) to all 8 locale files (en, de, fr, nl, es, it, pt, zh) so key parity is preserved (enforced by `tests/frontend.test.js`). + ## [1.49.1] - 2026-05-02 ### Changed diff --git a/package-lock.json b/package-lock.json index de9d067..02dc4f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cv-manager", - "version": "1.49.1", + "version": "1.49.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cv-manager", - "version": "1.49.1", + "version": "1.49.2", "dependencies": { "archiver": "^7.0.1", "better-sqlite3": "^9.4.3", diff --git a/package.json b/package.json index 0419813..8ad69e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cv-manager", - "version": "1.49.1", + "version": "1.49.2", "description": "Professional CV Management System", "main": "src/server.js", "scripts": { diff --git a/public/shared/admin.js b/public/shared/admin.js index 7ae1f4a..3713d9b 100644 --- a/public/shared/admin.js +++ b/public/shared/admin.js @@ -825,7 +825,7 @@ function renderCustomSection(section) { `; @@ -867,7 +867,7 @@ function renderGridLayout(items, cols) { ${item.title && !hideTitle ? `

${escapeHtml(item.title)}

` : ''} ${item.subtitle ? `
${escapeHtml(item.subtitle)}
` : ''} ${item.description ? `
${renderMarkdown(item.description, { mode: 'block' })}
` : ''} - ${item.link ? `View →` : ''} + ${item.link ? `${t('view_link')}` : ''} `; }).join('')}`; @@ -887,7 +887,7 @@ function renderListLayout(items) { ${item.subtitle ? `
${escapeHtml(item.subtitle)}
` : ''} ${item.description ? `
${renderMarkdown(item.description, { mode: 'block' })}
` : ''} - ${item.link ? `View →` : ''} + ${item.link ? `${t('view_link')}` : ''} `; }).join('')}`; @@ -905,7 +905,7 @@ function renderCardsLayout(items) { ${item.title && !hideTitle ? `

${escapeHtml(item.title)}

` : ''} ${item.subtitle ? `
${escapeHtml(item.subtitle)}
` : ''} ${item.description ? `
${renderMarkdown(item.description, { mode: 'block' })}
` : ''} - ${item.link ? `Learn More →` : ''} + ${item.link ? `${t('learn_more')}` : ''} `; }).join('')}`; @@ -1050,13 +1050,13 @@ async function loadExperiences() { - - - `; @@ -1089,15 +1089,15 @@ async function loadCertifications() { const hasLink = isValidUrl(cert.credential_id); return `