The cardio target keeps its translation now that it goes through MUSCLE_NAME — "Cardiovascular system" in all 14 packs (QA C9 follow-up)

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/…
This commit is contained in:
Duarte Santos committed 2026-09-19 21:34:30 +02:00
1 parent 2bf86a5318
commit 6796e559d3
16 files changed
+43 -2

No files matched your search

+2 -2
View File
@@ -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', () => {
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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é',
+1
View File
@@ -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 से वज़न',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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 건강의 체중',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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',
+1
View File
@@ -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ığı',
+1
View File
@@ -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 健康的体重',
+14
View File
@@ -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(<MuscleExplorer onDetail={vi.fn()} onPlan={vi.fn()} />)
+14
View File
@@ -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) }
})
})