From 6796e559d3e502d589ad2f856869d2e8b1d6da18 Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Sat, 19 Sep 2026 21:34:30 +0200 Subject: [PATCH] =?UTF-8?q?The=20cardio=20target=20keeps=20its=20translati?= =?UTF-8?q?on=20now=20that=20it=20goes=20through=20MUSCLE=5FNAME=20?= =?UTF-8?q?=E2=80=94=20"Cardiovascular=20system"=20in=20all=2014=20packs?= =?UTF-8?q?=20(QA=20C9=20follow-up)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Routing the target through MUSCLE_NAME (2bf86a5) mapped "cardiovascular system" to the display name "Cardiovascular system", which no pack carried — only the lowercase dataset key had a translation. Every built-in cardio exercise (29 in the dataset, plus custom cardio) therefore fell back to English in the picker row, the routine config sheet and the workout tag, where the parent build already said "Herz-Kreislauf". The display name now carries the same translation each pack had for the dataset key (pt-BR inherits it from pt-PT like the other muscle names; fingerprint regenerated: 648 inherited). That also cures the Library row and the detail sheet, which mapped through MUSCLE_NAME before this branch and leaked English there all along. Regression tests: picker row + config sheet (sheets.muscle-names.test.jsx) and the workout tag (Workout.test.jsx) for burpee 1160 in German, both failing before this change. Rig check on the branch build (slot 71, de): configTags Cardio/Herz-Kreislauf/Körpergewicht, picker row "burpee — Herz-Kreislauf · Körpergewicht", workout tags identical to the config tags, Library row "Herz-Kreislauf · Körpergewicht", detail sheet Cardio/Herz-Kreislauf/Körpergewicht/… --- frontend/src/lib/pt-br-locale.test.js | 4 ++-- frontend/src/locales/de.js | 1 + frontend/src/locales/es.js | 1 + frontend/src/locales/fr.js | 1 + frontend/src/locales/hi.js | 1 + frontend/src/locales/hu.js | 1 + frontend/src/locales/it.js | 1 + frontend/src/locales/ko.js | 1 + frontend/src/locales/pl.js | 1 + frontend/src/locales/pt.js | 1 + frontend/src/locales/ru.js | 1 + frontend/src/locales/th.js | 1 + frontend/src/locales/tr.js | 1 + frontend/src/locales/zh.js | 1 + frontend/src/sheets.muscle-names.test.jsx | 14 ++++++++++++++ frontend/src/views/Workout.test.jsx | 14 ++++++++++++++ 16 files changed, 43 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js index f692c60..72a71fc 100644 --- a/frontend/src/lib/pt-br-locale.test.js +++ b/frontend/src/lib/pt-br-locale.test.js @@ -28,10 +28,10 @@ describe('Brazilian Portuguese locale', () => { const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex') expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(644) - expect(inherited).toHaveLength(647) + expect(inherited).toHaveLength(648) // If this fails, review the changed keys and wording before accepting a new hash. From // frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list - expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('185cca3dfbc438a4a2177956d1d18da2bbdc907281c5eb4c858ba34afaf9f38e') + expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('32e5fc261a849772b42241c352d99ecf49a4a8ec640b52379031b6654f53deb8') }) test('does not leak European Portuguese UI terms', () => { diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js index fad9cba..e1fd7d5 100644 --- a/frontend/src/locales/de.js +++ b/frontend/src/locales/de.js @@ -504,6 +504,7 @@ export default { 'Hip flexors': 'Hüftbeuger', 'Calves': 'Waden', 'Shins': 'Schienbein', + 'Cardiovascular system': 'Herz-Kreislauf', // --- import from another app --- 'Import from another app': 'Aus anderer App importieren', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — oder Körpergewicht aus Apple Health', diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js index 68e2144..fd07819 100644 --- a/frontend/src/locales/es.js +++ b/frontend/src/locales/es.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Flexores de cadera', 'Calves': 'Gemelos', 'Shins': 'Tibiales', + 'Cardiovascular system': 'sistema cardiovascular', // --- import from another app --- 'Import from another app': 'Importar de otra app', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — o peso corporal de Apple Health', diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js index ff4b17c..1fab885 100644 --- a/frontend/src/locales/fr.js +++ b/frontend/src/locales/fr.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Fléchisseurs de hanche', 'Calves': 'Mollets', 'Shins': 'Tibiaux', + 'Cardiovascular system': 'système cardiovasculaire', // --- import from another app --- 'Import from another app': 'Importer depuis une autre app', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — ou le poids depuis Apple Santé', diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js index da466b3..854265f 100644 --- a/frontend/src/locales/hi.js +++ b/frontend/src/locales/hi.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'हिप फ्लेक्सर', 'Calves': 'पिंडली', 'Shins': 'पिंडली की हड्डी', + 'Cardiovascular system': 'हृदय प्रणाली', // --- import from another app --- 'Import from another app': 'दूसरे ऐप से आयात करें', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — या Apple Health से वज़न', diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js index f99fa4f..fea8eb6 100644 --- a/frontend/src/locales/hu.js +++ b/frontend/src/locales/hu.js @@ -490,6 +490,7 @@ export default { 'Hip flexors': 'Csípőhajlító', 'Calves': 'Vádli', 'Shins': 'Sípcsont', + 'Cardiovascular system': 'szív-érrendszer', // --- import from another app --- 'Import from another app': 'Importálás másik appból', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — vagy testsúly az Apple Healthből', diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js index 3c8c841..99533bc 100644 --- a/frontend/src/locales/it.js +++ b/frontend/src/locales/it.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Flessori dell\'anca', 'Calves': 'Polpacci', 'Shins': 'Tibiali', + 'Cardiovascular system': 'sistema cardiovascolare', // --- import from another app --- 'Import from another app': 'Importa da un\'altra app', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — o il peso da Apple Salute', diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js index 48ea492..65420b2 100644 --- a/frontend/src/locales/ko.js +++ b/frontend/src/locales/ko.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': '고관절 굴곡근', 'Calves': '종아리', 'Shins': '정강이', + 'Cardiovascular system': '심혈관계', // --- import from another app --- 'Import from another app': '다른 앱에서 가져오기', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — 또는 Apple 건강의 체중', diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js index 213baab..dd2a845 100644 --- a/frontend/src/locales/pl.js +++ b/frontend/src/locales/pl.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Zginacze bioder', 'Calves': 'Łydki', 'Shins': 'Piszczele', + 'Cardiovascular system': 'układ krążenia', // --- import from another app --- 'Import from another app': 'Importuj z innej aplikacji', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — albo masa ciała z Apple Health', diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js index ea44d46..22af99c 100644 --- a/frontend/src/locales/pt.js +++ b/frontend/src/locales/pt.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Flexores do quadril', 'Calves': 'Panturrilhas', 'Shins': 'Tibiais', + 'Cardiovascular system': 'sistema cardiovascular', // --- import from another app --- 'Import from another app': 'Importar de outra app', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — ou o peso da Apple Saúde', diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js index 46ce8ef..6e60694 100644 --- a/frontend/src/locales/ru.js +++ b/frontend/src/locales/ru.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Сгибатели бедра', 'Calves': 'Икры', 'Shins': 'Голени', + 'Cardiovascular system': 'сердечно-сосудистая система', // --- import from another app --- 'Import from another app': 'Импорт из другого приложения', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — или вес из Apple Health', diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js index f2b372d..d75ff9a 100644 --- a/frontend/src/locales/th.js +++ b/frontend/src/locales/th.js @@ -490,6 +490,7 @@ export default { 'Hip flexors': 'กล้ามเนื้องอสะโพก', 'Calves': 'น่อง', 'Shins': 'หน้าแข้ง', + 'Cardiovascular system': 'ระบบหัวใจและหลอดเลือด', // --- import from another app --- 'Import from another app': 'นำเข้าจากแอปอื่น', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — หรือน้ำหนักตัวจาก Apple Health', diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js index 95720d1..61ae963 100644 --- a/frontend/src/locales/tr.js +++ b/frontend/src/locales/tr.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': 'Kalça fleksörleri', 'Calves': 'Baldırlar', 'Shins': 'İncik', + 'Cardiovascular system': 'kalp-damar sistemi', // --- import from another app --- 'Import from another app': 'Başka uygulamadan içe aktar', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes, Strong, Hevy — veya Apple Health\'ten vücut ağırlığı', diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js index f45110e..241528a 100644 --- a/frontend/src/locales/zh.js +++ b/frontend/src/locales/zh.js @@ -485,6 +485,7 @@ export default { 'Hip flexors': '髋屈肌', 'Calves': '小腿', 'Shins': '胫前肌', + 'Cardiovascular system': '心血管系统', // --- import from another app --- 'Import from another app': '从其他应用导入', 'FitNotes, Strong, Hevy — or body weight from Apple Health': 'FitNotes、Strong、Hevy — 或来自 Apple 健康的体重', diff --git a/frontend/src/sheets.muscle-names.test.jsx b/frontend/src/sheets.muscle-names.test.jsx index fdb3c9a..10a5537 100644 --- a/frontend/src/sheets.muscle-names.test.jsx +++ b/frontend/src/sheets.muscle-names.test.jsx @@ -96,6 +96,20 @@ describe('muscle names in the rows and tags (QA C9)', () => { expect(rowFor(host, 'QA Custom Thrust').querySelector('.ss').textContent).toBe('Gesäß · Langhantel') }) + // The dataset's cardio target "cardiovascular system" is both a map id and a translated key + // of its own. Routing it through MUSCLE_NAME must not cost it its translation: the 29 + // built-in cardio exercises read "Herz-Kreislauf" in German, never "Cardiovascular system". + it('keeps the cardio target translated (burpee, de)', () => { + _setLangState('de', de, null, null) + exercisePicker(vi.fn()) + const host = renderTop() + act(() => type(host.querySelector('input.input'), 'burpee')) + expect(rowFor(host, 'burpee').querySelector('.ss').textContent).toBe('Herz-Kreislauf · Körpergewicht') + exConfigSheet(EXIDX['1160'], null, vi.fn()) + const tags = [...renderTop().querySelectorAll('.tag')].map(e => e.textContent.trim()) + expect(tags).toEqual(['Cardio', 'Herz-Kreislauf', 'Körpergewicht']) + }) + it('Muscles explorer row names the target the same way', () => { seed(custom()) const host = render() diff --git a/frontend/src/views/Workout.test.jsx b/frontend/src/views/Workout.test.jsx index 49b9f0f..c58ceee 100644 --- a/frontend/src/views/Workout.test.jsx +++ b/frontend/src/views/Workout.test.jsx @@ -1383,4 +1383,18 @@ describe('Workout exercise tags', () => { expect(tags).not.toContain('gluteal') } finally { registerCustom([]) } }) + + // The cardio target "cardiovascular system" is a translated key of its own; mapping it through + // MUSCLE_NAME must not turn "Herz-Kreislauf" back into English for every built-in cardio exercise. + it('keeps the cardio target translated (burpee, de)', async () => { + const { _setLangState } = await import('../lib/i18n-core.js') + const { default: de } = await import('../locales/de.js') + _setLangState('de', de, null, null) + try { + await mount([exercise('1160', [false])]) + const tags = [...container.querySelectorAll('.tag')].map(tag => tag.textContent.trim()) + expect(tags).toContain('Herz-Kreislauf') + expect(tags).not.toContain('Cardiovascular system') + } finally { _setLangState('en', null, null, null) } + }) })