Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Merge #254: Exercise-name packs for it/de/es/fr plus two per-language English-name toggles (giulioleuci)

Duarte Santosd6d361a22501
diff --cc frontend/src/lib/i18n-core.js
index dc29c51c8,63538bfad..82fbe5c8c
--- a/frontend/src/lib/i18n-core.js
+++ b/frontend/src/lib/i18n-core.js
@@@ -10,7 -10,7 +10,7 @@@ export const LANGS =
ko: '한국어', hi: 'हिन्दी', th: 'ไทย', hu: 'Magyar'
}
export const INSTR_LANGS = ['en', 'es', 'fr', 'it', 'tr', 'ru', 'zh', 'hi', 'pl', 'ko', 'pt-BR', 'hu']
- export const EXERCISE_NAME_LANGS = ['pt-BR', 'hu', 'de', 'es', 'ru']
-export const EXERCISE_NAME_LANGS = ['pt-BR', 'hu', 'it', 'de', 'es', 'fr']
++export const EXERCISE_NAME_LANGS = ['pt-BR', 'hu', 'de', 'es', 'ru', 'it', 'fr']
export const DATE_LOCALES = {
en: 'en-GB', de: 'de-DE', 'de-CH': 'de-CH', es: 'es-ES', fr: 'fr-FR', it: 'it-IT',
pt: 'pt-PT', 'pt-BR': 'pt-BR',
@@@ -73,11 -75,12 +75,14 @@@ export function t(s, ...args)
// Instructions for an exercise in the current language (English steps as fallback).
export const instrFor = ex => (instr && instr[ex.id]) || ex.st || []
-// Built-in catalogue names are bilingual when a complete translated name pack is active.
+// Built-in catalogue names are bilingual when a translated name pack is active. A pack need not
+// be complete: German covers the equipment exercises and not the body-weight ones, and an
+// exercise the pack has no entry for keeps its English title, one exercise at a time.
// User-created exercises have no entry in the pack and keep their exact chosen name.
export const exerciseNameFor = ex => {
+ // A language that chose "English names only" sees the canonical catalogue title, not the
+ // translation — and never the parenthetical either. Custom exercises keep their exact name.
+ if (enOnly) return ex?.n || ''
const translated = exerciseNames && ex && exerciseNames[ex.id]
if (!translated) return ex?.n || ''
// Some names (Burpee, Pilates, brand/model terms) are the established term in the target
diff --cc frontend/src/lib/i18n.js
index 58a3a7c5f,c6fdf6bba..53b1c4b0a
--- a/frontend/src/lib/i18n.js
+++ b/frontend/src/lib/i18n.js
@@@ -12,7 -12,7 +12,7 @@@ import
export {
LANGS, INSTR_LANGS, EXERCISE_NAME_LANGS, DATE_LOCALES, DERIVED_LOCALES,
- getLang, dateLocale, t, instrFor, exerciseNameFor, exerciseNameSearchText, exerciseNameClass
- getLang, dateLocale, t, instrFor, exerciseNameFor, exerciseNameSearchText, baseLang
++ getLang, dateLocale, t, instrFor, exerciseNameFor, exerciseNameSearchText, exerciseNameClass, baseLang
}
// Vite code-splits locale, instruction and exercise-name packs via import.meta.glob. They are
diff --cc frontend/src/store/useStore.js
index 5e72081bc,556963d4f..d7a30fe3f
--- a/frontend/src/store/useStore.js
+++ b/frontend/src/store/useStore.js
@@@ -103,11 -82,15 +103,20 @@@ export const DEF =
// the session straight away; weight can still be logged from Home/Stats. Defaults on; an
// older profile without the key reads as on (`!== false`).
weighIn: true,
+ // Where a planned session's reps come from (Settings → During a workout, lib/session-start.js):
+ // 'plan' opens at the routine's own sets × reps and lets history and progression decide the
+ // weight; 'last' carries the reps over from the last session, the way it always worked before.
+ // Absent reads as 'plan' too, which is what the MCP bridge sees on a raw state file.
+ startFrom: 'plan',
+ // Per-language choice for translated exercise names: whether the original English name is
+ // shown in parentheses next to the translation. Map { '<lang>': boolean }; a missing key
+ // (any profile written before this setting existed) reads as shown.
+ enParens: {},
+ // Per-language choice for translated exercise names: whether the translation is replaced
+ // entirely by the original English name. Independent of enParens and keyed by the same base
+ // language, so e.g. Italian can keep its parens while German pins names to English. Map
+ // { '<lang>': boolean }; a missing key reads as off (translation shown as usual).
+ enOnly: {},
}
const clone = o => JSON.parse(JSON.stringify(o))
diff --cc frontend/src/views/Settings.jsx
index 33901b05a,ab9afa04a..d38934c88
--- a/frontend/src/views/Settings.jsx
+++ b/frontend/src/views/Settings.jsx
@@@ -7,10 -7,10 +7,10 @@@ import { useUI } from '../store/useUI.j
import { ACCENTS, todayISO, localTZ, weekStartOf, MONDAY, SUNDAY } from '../lib/format.js'
import { effortOf } from '../lib/history.js'
import { unlock, playOnSilentSupported } from '../lib/sound.js'
-import { api, webauthnOK, passkeyLogin, passkeyRegister, IS_ANDROID } from '../lib/api.js'
+import { api, webauthnOK, passkeyRegister, IS_ANDROID } from '../lib/api.js'
import { pushSupported, enablePush, disablePush, sendTestPush, syncPushSubscription } from '../lib/push.js'
import { wakeLockSupported } from '../lib/wakelock.js'
- import { t, LANGS, INSTR_LANGS } from '../lib/i18n.js'
+ import { t, LANGS, INSTR_LANGS, EXERCISE_NAME_LANGS, baseLang } from '../lib/i18n.js'
import { DEMO, REPO } from '../lib/demo.js'
import { MOBILE, isAndroid, shareExport, syncReminder } from '../lib/mobile.js'
import { checkForUpdate, downloadAndInstall } from '../lib/update.js'