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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Settings → Apple Watch on the iPhone; the watch reports back
Duarte Santose4f493877504
diff --git a/frontend/ios/App/Watch/OpenGymWatchApp.swift b/frontend/ios/App/Watch/OpenGymWatchApp.swiftindex 189cbc215..0ff42674f 100644--- a/frontend/ios/App/Watch/OpenGymWatchApp.swift+++ b/frontend/ios/App/Watch/OpenGymWatchApp.swift@@ -154,7 +154,6 @@ struct IdleView: View {}.padding(.top, 6)}- HealthToggle(health: store.health).padding(.top, 6)}.padding(.horizontal, 4)}diff --git a/frontend/ios/App/Watch/SessionStore.swift b/frontend/ios/App/Watch/SessionStore.swiftindex 26d8ef78a..8d8298546 100644--- a/frontend/ios/App/Watch/SessionStore.swift+++ b/frontend/ios/App/Watch/SessionStore.swift@@ -81,8 +81,9 @@ final class SessionStore: NSObject, ObservableObject, WCSessionDelegate, UNUserN// Relaunched (mid-workout or not): the session as it was, then the latest from the phone.state = savedloadTargets()- if saved.workout != nil { health.start() }+ if let w = saved.workout { health.start(workoutId: w.id) }}+ health.onStatus = { [weak self] in self?.sendStatus() }let center = UNUserNotificationCenter.current()center.delegate = selfif !isDemo { center.requestAuthorization(options: [.alert, .sound]) { _, _ in } }@@ -161,7 +162,7 @@ final class SessionStore: NSObject, ObservableObject, WCSessionDelegate, UNUserN// A workout this watch picks up (the app opened mid-workout, or the phone started one).self.setStartedAt = Date()self.picked = [:]- self.health.start()+ self.health.start(workoutId: next.workout?.id)}if let rest = snap.active?.rest, next.workout?.id == snap.active?.id {let end = Date(timeIntervalSince1970: rest.endsAt / 1000)@@ -219,7 +220,7 @@ final class SessionStore: NSObject, ObservableObject, WCSessionDelegate, UNUserNsetStartedAt = nowrestAfter = nilloadTargets()- health.start()+ health.start(workoutId: next.workout?.id)send(event: event)WKInterfaceDevice.current().play(.start)}@@ -362,6 +363,14 @@ final class SessionStore: NSObject, ObservableObject, WCSessionDelegate, UNUserNfunc session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {// The phone's latest snapshot: also what a watch app opened mid-workout picks the session up from.if let json = session.receivedApplicationContext["snapshot"] as? String { apply(json: json) }+ sendStatus()+ }++ /// What the phone's Settings → Apple Watch shows about this watch.+ func sendStatus() {+ let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""+ send(event: ["id": UUID().uuidString, "type": "watchStatus", "health": health.status, "version": version,+ "at": Date().timeIntervalSince1970 * 1000])}func session(_ session: WCSession, didReceiveApplicationContext applicationContext: [String: Any]) {diff --git a/frontend/ios/App/Watch/WorkoutManager.swift b/frontend/ios/App/Watch/WorkoutManager.swiftindex cbb5d7879..d94695115 100644--- a/frontend/ios/App/Watch/WorkoutManager.swift+++ b/frontend/ios/App/Watch/WorkoutManager.swift@@ -54,6 +54,13 @@ final class WorkoutManager: NSObject, ObservableObject, HKWorkoutSessionDelegate}}+ /// "on", "off" or "denied", for the phone's Settings → Apple Watch.+ var status: String {+ guard HKHealthStore.isHealthDataAvailable() else { return "off" }+ if store.authorizationStatus(for: HKObjectType.workoutType()) == .sharingDenied { return "denied" }+ return enabled ? "on" : "off"+ }+/// The phone's setting, when it sends one: on asks for the permission (once) right away.func syncSetting(_ on: Bool?) {guard let on = on, on != enabled else { return }@@ -61,16 +68,25 @@ final class WorkoutManager: NSObject, ObservableObject, HKWorkoutSessionDelegaterequestAuthorization { ok inself.enabled = okif ok && self.wanted { self.start() }+ self.onStatus?()}} else {enabled = falseend(save: true)+ onStatus?()}}+ /// Told when the status changes (SessionStore reports it to the phone).+ var onStatus: (() -> Void)?++ /// The workout's id, for Apple Health's sync identifier (the phone writes none of its own then).+ private var workoutId: String?+/// A workout started here or picked up from the phone: the session starts now.- func start() {+ func start(workoutId wid: String? = nil) {wanted = true+ if let wid = wid { workoutId = wid }guard enabled, session == nil, HKHealthStore.isHealthDataAvailable() else { return }let config = HKWorkoutConfiguration()config.activityType = .traditionalStrengthTraining@@ -88,6 +104,10 @@ final class WorkoutManager: NSObject, ObservableObject, HKWorkoutSessionDelegatelet now = Date()s.startActivity(with: now)b.beginCollection(withStart: now) { _, _ in }+ // One workout in Apple Health, not two: the phone skips writing one with this sync id.+ if let wid = workoutId {+ b.addMetadata([HKMetadataKeySyncIdentifier: "opengym-w-\(wid)", HKMetadataKeySyncVersion: 1]) { _, _ in }+ }startQuery(from: now)running = true} catch {@@ -120,6 +140,7 @@ final class WorkoutManager: NSObject, ObservableObject, HKWorkoutSessionDelegate/// The workout ended: saved to Apple Health, or dropped when `save` is false.func end(save: Bool) {wanted = false+ workoutId = nilif let q = query { store.stop(q); query = nil }guard let s = session, let b = builder else { return }s.end()diff --git a/frontend/src/components/Icon.jsx b/frontend/src/components/Icon.jsxindex f52850bff..ebf1f858c 100644--- a/frontend/src/components/Icon.jsx+++ b/frontend/src/components/Icon.jsx@@ -161,6 +161,7 @@ const P = {plusCircle: <><circle cx="12" cy="12" r="8.2" /><path d="M12 8.2v7.6M8.2 12h7.6" /></>,// a timed set's clock (timer stays the rest timer)stopwatch: <><circle cx="12" cy="13.4" r="7.2" /><path d="M12 9.6v3.8M9.6 3.4h4.8M18 7.2l1.4-1.4" /></>,+ watch: <><rect x="6.6" y="6.4" width="10.8" height="11.2" rx="3" /><path d="M9 6.4l.6-3h4.8l.6 3M9 17.6l.6 3h4.8l.6-3M12 9.6V12l1.6 1" /></>,// exercise settings: two slidersslider: <><path d="M4.4 7.4h9.2M17.8 7.4h1.8M4.4 16.6h1.8M10.4 16.6h9.2" /><circle cx="15.7" cy="7.4" r="2.1" /><circle cx="8.3" cy="16.6" r="2.1" /></>,diff --git a/frontend/src/lib/watch-settings.js b/frontend/src/lib/watch-settings.jsnew file mode 100644index 000000000..d0d3f8e77--- /dev/null+++ b/frontend/src/lib/watch-settings.js@@ -0,0 +1,52 @@+// Settings → Apple Watch (iPhone app only): this phone's choices for its watch, and what the watch+// last said about itself. Per device, in localStorage, never in the profile: a profile signed in on+// two phones may have one watch, or none. The watch gets the choices with every snapshot+// (lib/watch-sync.js, `settings`); it reports back with a watchStatus event.+//+// enabled send workouts to the watch at all (off: the watch shows nothing to do)+// health Apple Health on the watch: workout session, live heart rate, saved workouts+// restHaptics the wrist taps when a rest is over+// crown what the Digital Crown turns first on a set: 'reps' or 'weight'+export const WATCH_PREFS_KEY = 'gym_watch_v1'+export const WATCH_STATUS_KEY = 'gym_watch_status_v1'+export const WATCH_DEFAULTS = Object.freeze({ enabled: true, health: false, restHaptics: true, crown: 'reps' })++const listeners = new Set()+export const onWatchPrefs = fn => { listeners.add(fn); return () => listeners.delete(fn) }+const emit = () => { for (const fn of listeners) { try { fn() } catch { /* a listener's problem */ } } }++const read = (key, storage) => { try { return JSON.parse(storage?.getItem(key) || 'null') } catch { return null } }++export function readWatchPrefs(storage = globalThis.localStorage) {+ const v = read(WATCH_PREFS_KEY, storage) || {}+ return {+ enabled: v.enabled !== false,+ health: v.health === true,+ restHaptics: v.restHaptics !== false,+ crown: v.crown === 'weight' ? 'weight' : 'reps',+ }+}++export function writeWatchPrefs(patch, storage = globalThis.localStorage) {+ const next = readWatchPrefs({ getItem: () => JSON.stringify({ ...readWatchPrefs(storage), ...patch }) })+ try { storage?.setItem(WATCH_PREFS_KEY, JSON.stringify(next)) } catch { /* private mode: for this run */ }+ emit()+ return next+}++/** What the watch said last: { health: 'on'|'off'|'denied', version, at } or null. */+export function readWatchStatus(storage = globalThis.localStorage) {+ const v = read(WATCH_STATUS_KEY, storage)+ return v && typeof v === 'object' ? v : null+}++export function writeWatchStatus(ev, storage = globalThis.localStorage) {+ const health = ['on', 'off', 'denied'].includes(ev?.health) ? ev.health : null+ const next = { health, version: typeof ev?.version === 'string' ? ev.version.slice(0, 20) : null, at: Number(ev?.at) || Date.now() }+ try { storage?.setItem(WATCH_STATUS_KEY, JSON.stringify(next)) } catch { /* shown again next time */ }+ emit()+ return next+}++/** The choices as the watch reads them (WatchCore Model.swift WatchSettings). */+export const settingsForWatch = (p = readWatchPrefs()) => ({ health: p.health, restHaptics: p.restHaptics, crown: p.crown })diff --git a/frontend/src/lib/watch-settings.test.js b/frontend/src/lib/watch-settings.test.jsnew file mode 100644index 000000000..e74238fa3--- /dev/null+++ b/frontend/src/lib/watch-settings.test.js@@ -0,0 +1,36 @@+// @vitest-environment happy-dom+// Settings → Apple Watch: this phone's choices for its watch, per device, never in the profile.+import { beforeEach, describe, expect, it, vi } from 'vitest'+import { readWatchPrefs, writeWatchPrefs, settingsForWatch, readWatchStatus, writeWatchStatus, onWatchPrefs, WATCH_DEFAULTS } from './watch-settings.js'+import { applyEvents, bindWatchAppActions, _resetWatchSync } from './watch-sync.js'++beforeEach(() => { localStorage.clear(); _resetWatchSync() })++describe('the choices', () => {+ it('start from the defaults and keep what is set, nothing else', () => {+ expect(readWatchPrefs()).toEqual({ ...WATCH_DEFAULTS })+ const seen = vi.fn()+ onWatchPrefs(seen)+ expect(writeWatchPrefs({ health: true, crown: 'weight', junk: 1 })).toEqual({ enabled: true, health: true, restHaptics: true, crown: 'weight' })+ expect(readWatchPrefs().crown).toBe('weight')+ expect(seen).toHaveBeenCalled()+ localStorage.setItem('gym_watch_v1', '{broken')+ expect(readWatchPrefs()).toEqual({ ...WATCH_DEFAULTS })+ })++ it('go to the watch as its settings, and live outside the profile', () => {+ writeWatchPrefs({ restHaptics: false })+ expect(settingsForWatch()).toEqual({ health: false, restHaptics: false, crown: 'reps' })+ expect(localStorage.getItem('gym_state_v1')).toBeNull()+ })+})++describe('what the watch says about itself', () => {+ it('is kept for the page, whatever else waits in the queue', () => {+ bindWatchAppActions({ start: vi.fn(), patchSet: vi.fn() })+ expect(applyEvents([{ id: 's1', type: 'watchStatus', health: 'denied', version: '1.4.2', at: 5 }], () => ({ S: { active: null } }))).toEqual(['s1'])+ expect(readWatchStatus()).toEqual({ health: 'denied', version: '1.4.2', at: 5 })+ writeWatchStatus({ health: 'weird' })+ expect(readWatchStatus().health).toBeNull()+ })+})diff --git a/frontend/src/lib/watch-sync.js b/frontend/src/lib/watch-sync.jsindex 7418cbc8c..558fc7deb 100644--- a/frontend/src/lib/watch-sync.js+++ b/frontend/src/lib/watch-sync.js@@ -25,6 +25,7 @@ import { sessionHistory } from './backfill.js'import { buildCombinedEntries, deriveSessionName } from './session-merge.js'import { todayISO } from './format.js'import { sanitizeHr } from './heart-rate.js'+import { readWatchPrefs, settingsForWatch, writeWatchStatus, onWatchPrefs } from './watch-settings.js'export const SNAPSHOT_VERSION = 1const APPLIED_KEY = 'gym_watch_applied'@@ -198,6 +199,9 @@ export function applyEvents (events, getState) {const idx = entryIndexOf(A, ev)const set = idx >= 0 ? A.entries[idx].sets?.[ev.setIdx] : nullif (set) handlers.setDone(idx, ev.setIdx, { w: num(ev.w), r: num(ev.r), at: num(ev.at), hr: sanitizeHr(ev.hr) })+ } else if (ev.type === 'watchStatus') {+ // What the watch says about itself, for Settings → Apple Watch. Never queued behind anything.+ writeWatchStatus(ev)} else if (ev.type === 'setHr') {// The rest's heart rate comes once the rest is over, maybe after the workout was saved:// a field on that set, wherever the set is now. Nothing for a reading that does not hold up.@@ -300,13 +304,19 @@ export async function startWatchSync ({ useStore, useUI }) {if (!linked) returntry {const S = useStore.getState().S- const json = JSON.stringify(buildSnapshot(S, { timer: useUI.getState().timer, ready: readyFor(S) }))+ const prefs = readWatchPrefs()+ // Settings → Apple Watch: off, the watch is told there is nothing (no workout, nothing ready).+ const snap = prefs.enabled+ ? buildSnapshot(S, { timer: useUI.getState().timer, ready: readyFor(S) })+ : { v: SNAPSHOT_VERSION, unit: S.unit === 'lb' ? 'lb' : 'kg', active: null, ready: null }+ snap.settings = settingsForWatch(prefs)+ const json = JSON.stringify(snap)if (json !== lastSent) {const r = await p.WatchBridge.sendSnapshot({ json })if (r && r.sent) lastSent = json}// The workout's animations, once per workout and exercise (the native side remembers).- const clips = clipsFor(S)+ const clips = prefs.enabled ? clipsFor(S) : []const key = S.active ? S.active.id + '|' + clips.map(c => c.exId).join(',') : ''if (clips.length && key !== lastClips) {await p.WatchBridge.sendClips({ wid: S.active.id, clips })@@ -319,12 +329,13 @@ export async function startWatchSync ({ useStore, useUI }) {// The rest as the watch needs it changes when it starts, stops or is paused, not every second.const restOf = t => (t ? `${t.endsAt}|${!!t.paused}|${!!t.ready}` : '')const offUI = useUI.subscribe((s, prev) => { if (s.timer !== prev.timer && restOf(s.timer) !== restOf(prev.timer)) schedule() })+ const offPrefs = onWatchPrefs(() => schedule())const sub = await p.WatchBridge.addListener('watchEvent', () => { drainWatchEvents() })const onVisible = () => { if (document.visibilityState === 'visible') { drainWatchEvents(); checkLink().then(() => schedule()) } }document.addEventListener('visibilitychange', onVisible)schedule()drainWatchEvents()- return () => { offStore(); offUI(); sub?.remove?.(); document.removeEventListener('visibilitychange', onVisible); clearTimeout(tm) }+ return () => { offStore(); offUI(); offPrefs(); sub?.remove?.(); document.removeEventListener('visibilitychange', onVisible); clearTimeout(tm) }}// Test seams.@@ -365,3 +376,10 @@ export function patchSetIn (s, { wid, exId, entryIdx, setIdx }, fields, stamp, {if (stamp) stamp(w)return true}++/** Whether a watch is paired and has the app, for Settings → Apple Watch. */+export async function watchStatus () {+ const p = await watchPlugin()+ if (!p) return { paired: false, installed: false }+ try { const st = await p.WatchBridge.status(); return { paired: !!st?.paired, installed: !!st?.installed } } catch { return { paired: false, installed: false } }+}diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex d6bef070a..7a8aa18a9 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -2410,4 +2410,16 @@ export default {'Skip completed exercises': 'تخطّي التمارين المكتملة',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'لا يستطيع هذا التطبيق التأكيد بمفتاح مرور. أنشئ الرمز في متصفح مسجّل الدخول إلى هذا الملف الشخصي، أو أضف كلمة مرور هناك أولًا.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'الوزن',+ 'Send workouts to the watch': 'إرسال التمارين إلى الساعة',+ 'Apple Health on the watch': 'صحتي على الساعة',+ 'Tap the wrist when a rest is over': 'نقرة على المعصم عند انتهاء الراحة',+ 'The Digital Crown turns first': 'التاج الرقمي يغيّر أولًا',+ 'No Apple Watch paired with this iPhone': 'لا توجد Apple Watch مقترنة بهذا الـ iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym ليس على Apple Watch بعد. ثبّته من تطبيق Watch.',+ 'openGym is on your Apple Watch': 'openGym موجود على Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'غير مسموح على الساعة. اسمح به من تطبيق صحتي على iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'النبض أثناء التمرين وبجانب كل مجموعة، والتمرين محفوظ في صحتي. تسأل الساعة مرة واحدة.',}diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.jsindex 6e6aff7da..d384e4458 100644--- a/frontend/src/locales/bn.js+++ b/frontend/src/locales/bn.js@@ -2434,4 +2434,16 @@ export default {'Skip completed exercises': 'শেষ হওয়া ব্যায়াম বাদ দিন',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'এই অ্যাপ পাসকি দিয়ে নিশ্চিত করতে পারে না। এই প্রোফাইলে সাইন ইন করা ব্রাউজারে কোডটি বানান, অথবা আগে সেখানে একটি পাসওয়ার্ড যোগ করুন।',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'ওজন',+ 'Send workouts to the watch': 'ওয়ার্কআউট ঘড়িতে পাঠান',+ 'Apple Health on the watch': 'ঘড়িতে Apple Health',+ 'Tap the wrist when a rest is over': 'বিশ্রাম শেষে কবজিতে টোকা',+ 'The Digital Crown turns first': 'Digital Crown প্রথমে বদলায়',+ 'No Apple Watch paired with this iPhone': 'এই iPhone-এর সাথে কোনো Apple Watch যুক্ত নেই',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym এখনও আপনার Apple Watch-এ নেই। Watch অ্যাপ থেকে ইনস্টল করুন।',+ 'openGym is on your Apple Watch': 'openGym আপনার Apple Watch-এ আছে',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'ঘড়িতে অনুমতি নেই। iPhone-এর Health অ্যাপে অনুমতি দিন।',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'ওয়ার্কআউটের সময় আর প্রতিটি সেটের পাশে হার্ট রেট, আর ওয়ার্কআউট Apple Health-এ সেভ। ঘড়ি একবার জিজ্ঞেস করে।',}diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex acd254b02..ad990ddcb 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -2375,4 +2375,16 @@ export default {'Skip completed exercises': 'Erledigte Übungen überspringen',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Diese App kann nicht mit einem Passkey bestätigen. Erstell den Code in einem Browser, der mit diesem Profil angemeldet ist, oder leg dort zuerst ein Passwort fest.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Gewicht',+ 'Send workouts to the watch': 'Trainings an die Watch senden',+ 'Apple Health on the watch': 'Apple Health auf der Watch',+ 'Tap the wrist when a rest is over': 'Am Handgelenk tippen, wenn die Pause vorbei ist',+ 'The Digital Crown turns first': 'Die Digital Crown dreht zuerst',+ 'No Apple Watch paired with this iPhone': 'Keine Apple Watch mit diesem iPhone gekoppelt',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym ist noch nicht auf deiner Apple Watch. Installiere es in der Watch-App.',+ 'openGym is on your Apple Watch': 'openGym ist auf deiner Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Auf der Watch nicht erlaubt. Erlaube es in der Health-App auf deinem iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Puls während des Trainings und neben jedem Satz, und das Training in Apple Health gespeichert. Die Watch fragt einmal.',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 17c5e205f..84c3f8695 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Saltar ejercicios completados',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Esta app no puede confirmar con una passkey. Crea el código en un navegador con este perfil abierto, o añade allí una contraseña primero.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Peso',+ 'Send workouts to the watch': 'Enviar entrenos al reloj',+ 'Apple Health on the watch': 'Salud en el reloj',+ 'Tap the wrist when a rest is over': 'Toque en la muñeca al acabar el descanso',+ 'The Digital Crown turns first': 'La Digital Crown ajusta primero',+ 'No Apple Watch paired with this iPhone': 'Ningún Apple Watch enlazado con este iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym aún no está en tu Apple Watch. Instálalo desde la app Watch.',+ 'openGym is on your Apple Watch': 'openGym está en tu Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'No permitido en el reloj. Permítelo en la app Salud de tu iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'El pulso durante el entreno y junto a cada serie, y el entreno guardado en Salud. El reloj pregunta una vez.',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex e6b0d7283..a57b426ff 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Sauter les exercices terminés',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Cette app ne peut pas confirmer avec une passkey. Crée le code dans un navigateur connecté à ce profil, ou ajoute d’abord un mot de passe là-bas.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Poids',+ 'Send workouts to the watch': 'Envoyer les séances à la montre',+ 'Apple Health on the watch': 'Santé sur la montre',+ 'Tap the wrist when a rest is over': 'Taper au poignet à la fin du repos',+ 'The Digital Crown turns first': 'La Digital Crown règle d’abord',+ 'No Apple Watch paired with this iPhone': 'Aucune Apple Watch jumelée à cet iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym n’est pas encore sur ton Apple Watch. Installe-le dans l’app Watch.',+ 'openGym is on your Apple Watch': 'openGym est sur ton Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Non autorisé sur la montre. Autorise-le dans l’app Santé de ton iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Le pouls pendant la séance et à côté de chaque série, et la séance enregistrée dans Santé. La montre demande une fois.',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 3abe897d5..02a744593 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'पूरे हुए व्यायाम छोड़ें',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'यह ऐप पासकी से पुष्टि नहीं कर सकता। इस प्रोफ़ाइल में साइन इन किए ब्राउज़र में कोड बनाएँ, या पहले वहाँ एक पासवर्ड जोड़ें।',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'वज़न',+ 'Send workouts to the watch': 'वर्कआउट वॉच पर भेजें',+ 'Apple Health on the watch': 'वॉच पर Apple Health',+ 'Tap the wrist when a rest is over': 'रेस्ट खत्म होने पर कलाई पर टैप',+ 'The Digital Crown turns first': 'Digital Crown पहले बदलता है',+ 'No Apple Watch paired with this iPhone': 'इस iPhone से कोई Apple Watch जुड़ी नहीं है',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym अभी आपकी Apple Watch पर नहीं है। Watch ऐप से इंस्टॉल करें।',+ 'openGym is on your Apple Watch': 'openGym आपकी Apple Watch पर है',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'वॉच पर अनुमति नहीं है। iPhone के Health ऐप में अनुमति दें।',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'वर्कआउट के दौरान और हर सेट के साथ धड़कन, और वर्कआउट Apple Health में सेव। वॉच एक बार पूछती है।',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 15a374586..35e3bd689 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -2358,4 +2358,16 @@ export default {'Skip completed exercises': 'Kész gyakorlatok átugrása',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Ez az app nem tud jelszókulccsal megerősíteni. Készítsd el a kódot egy böngészőben, ahol ebbe a profilba vagy bejelentkezve, vagy előbb adj meg ott egy jelszót.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Súly',+ 'Send workouts to the watch': 'Edzések küldése az órára',+ 'Apple Health on the watch': 'Egészség az órán',+ 'Tap the wrist when a rest is over': 'Koppintás a csuklón, ha letelt a pihenő',+ 'The Digital Crown turns first': 'A Digital Crown először ezt állítja',+ 'No Apple Watch paired with this iPhone': 'Nincs Apple Watch párosítva ezzel az iPhone-nal',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'Az openGym még nincs az Apple Watchodon. Telepítsd a Watch appban.',+ 'openGym is on your Apple Watch': 'Az openGym rajta van az Apple Watchodon',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Nincs engedélyezve az órán. Engedélyezd az iPhone Egészség appjában.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Pulzus edzés közben és minden sorozat mellett, az edzés az Egészség appba mentve. Az óra egyszer kérdez.',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex b850d06ea..eb4236e47 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Salta gli esercizi completati',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Questa app non può confermare con una passkey. Crea il codice in un browser con questo profilo, oppure aggiungi prima lì una password.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Peso',+ 'Send workouts to the watch': 'Invia gli allenamenti all’orologio',+ 'Apple Health on the watch': 'Salute sull’orologio',+ 'Tap the wrist when a rest is over': 'Tocco al polso a fine recupero',+ 'The Digital Crown turns first': 'La Digital Crown regola prima',+ 'No Apple Watch paired with this iPhone': 'Nessun Apple Watch abbinato a questo iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym non è ancora sul tuo Apple Watch. Installalo dall’app Watch.',+ 'openGym is on your Apple Watch': 'openGym è sul tuo Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Non consentito sull’orologio. Consentilo nell’app Salute dell’iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Il battito durante l’allenamento e accanto a ogni serie, e l’allenamento salvato in Salute. L’orologio chiede una volta.',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex fa17bf744..5fd519228 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': '끝난 운동 건너뛰기',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': '이 앱에서는 패스키로 확인할 수 없어요. 이 프로필로 로그인한 브라우저에서 코드를 만들거나, 먼저 그곳에서 비밀번호를 추가하세요.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': '무게',+ 'Send workouts to the watch': '운동을 워치로 보내기',+ 'Apple Health on the watch': '워치에서 건강 앱 연동',+ 'Tap the wrist when a rest is over': '휴식이 끝나면 손목을 톡',+ 'The Digital Crown turns first': 'Digital Crown이 먼저 바꾸는 값',+ 'No Apple Watch paired with this iPhone': '이 iPhone과 페어링된 Apple Watch가 없어요',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': '아직 Apple Watch에 openGym이 없어요. Watch 앱에서 설치하세요.',+ 'openGym is on your Apple Watch': 'Apple Watch에 openGym이 있어요',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': '워치에서 허용되지 않았어요. iPhone의 건강 앱에서 허용하세요.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': '운동 중과 각 세트 옆의 심박수, 그리고 건강 앱에 저장되는 운동. 워치가 한 번 물어봐요.',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 15ff80333..72563b007 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Pomijaj ukończone ćwiczenia',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Ta aplikacja nie może potwierdzić kluczem dostępu. Utwórz kod w przeglądarce zalogowanej na ten profil albo najpierw ustaw tam hasło.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Ciężar',+ 'Send workouts to the watch': 'Wysyłaj treningi na zegarek',+ 'Apple Health on the watch': 'Zdrowie na zegarku',+ 'Tap the wrist when a rest is over': 'Stuknij w nadgarstek po przerwie',+ 'The Digital Crown turns first': 'Digital Crown najpierw zmienia',+ 'No Apple Watch paired with this iPhone': 'Brak Apple Watch sparowanego z tym iPhone’em',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym nie ma jeszcze na Twoim Apple Watch. Zainstaluj go w aplikacji Watch.',+ 'openGym is on your Apple Watch': 'openGym jest na Twoim Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Brak zgody na zegarku. Zezwól w aplikacji Zdrowie na iPhonie.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Tętno podczas treningu i przy każdej serii, a trening zapisany w Zdrowiu. Zegarek zapyta raz.',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 47be80b28..ee8c12761 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -1488,6 +1488,18 @@ export const PT_BR_OVERRIDES = {'Skip completed exercises': 'Pular exercícios concluídos',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Este aplicativo não consegue confirmar com uma chave de acesso. Crie o código em um navegador conectado a este perfil, ou adicione uma senha lá primeiro.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Peso',+ 'Send workouts to the watch': 'Enviar treinos para o relógio',+ 'Apple Health on the watch': 'Saúde no relógio',+ 'Tap the wrist when a rest is over': 'Toque no pulso no fim do descanso',+ 'The Digital Crown turns first': 'A Digital Crown ajusta primeiro',+ 'No Apple Watch paired with this iPhone': 'Nenhum Apple Watch pareado com este iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'O openGym ainda não está no seu Apple Watch. Instale pelo app Watch.',+ 'openGym is on your Apple Watch': 'O openGym está no seu Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Não permitido no relógio. Permita no app Saúde do seu iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'A frequência cardíaca durante o treino e ao lado de cada série, e o treino salvo no Saúde. O relógio pergunta uma vez.',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex c3e2a2e29..2c9523002 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Saltar exercícios concluídos',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Esta app não consegue confirmar com uma passkey. Cria o código num navegador com este perfil, ou adiciona lá uma palavra-passe primeiro.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Peso',+ 'Send workouts to the watch': 'Enviar treinos para o relógio',+ 'Apple Health on the watch': 'Saúde no relógio',+ 'Tap the wrist when a rest is over': 'Toque no pulso no fim do descanso',+ 'The Digital Crown turns first': 'A Digital Crown ajusta primeiro',+ 'No Apple Watch paired with this iPhone': 'Nenhum Apple Watch emparelhado com este iPhone',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'O openGym ainda não está no teu Apple Watch. Instala-o na app Watch.',+ 'openGym is on your Apple Watch': 'O openGym está no teu Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Não permitido no relógio. Permite-o na app Saúde do teu iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'A frequência cardíaca durante o treino e ao lado de cada série, e o treino guardado na Saúde. O relógio pergunta uma vez.',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex 68a15428f..d69666dc6 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -2359,4 +2359,16 @@ export default {'Skip completed exercises': 'Пропускать выполненные упражнения',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Это приложение не может подтвердить ключом доступа. Создайте код в браузере, где вы вошли в этот профиль, или сначала задайте там пароль.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Вес',+ 'Send workouts to the watch': 'Отправлять тренировки на часы',+ 'Apple Health on the watch': 'Здоровье на часах',+ 'Tap the wrist when a rest is over': 'Касание запястья в конце отдыха',+ 'The Digital Crown turns first': 'Digital Crown сначала меняет',+ 'No Apple Watch paired with this iPhone': 'К этому iPhone не подключены Apple Watch',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym ещё нет на ваших Apple Watch. Установите его в приложении Watch.',+ 'openGym is on your Apple Watch': 'openGym установлен на ваших Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'На часах не разрешено. Разрешите в приложении «Здоровье» на iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Пульс во время тренировки и рядом с каждым подходом, тренировка сохраняется в «Здоровье». Часы спросят один раз.',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex c9bd3e60c..a708144ff 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -2366,4 +2366,16 @@ export default {'Skip completed exercises': 'ข้ามท่าที่ทำเสร็จแล้ว',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'แอปนี้ยืนยันด้วยพาสคีย์ไม่ได้ สร้างรหัสในเบราว์เซอร์ที่ลงชื่อเข้าใช้โปรไฟล์นี้ หรือเพิ่มรหัสผ่านที่นั่นก่อน',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'น้ำหนัก',+ 'Send workouts to the watch': 'ส่งการฝึกไปที่นาฬิกา',+ 'Apple Health on the watch': 'Apple Health บนนาฬิกา',+ 'Tap the wrist when a rest is over': 'แตะข้อมือเมื่อหมดเวลาพัก',+ 'The Digital Crown turns first': 'Digital Crown ปรับอะไรก่อน',+ 'No Apple Watch paired with this iPhone': 'ไม่มี Apple Watch ที่จับคู่กับ iPhone นี้',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'ยังไม่มี openGym บน Apple Watch ติดตั้งได้ในแอป Watch',+ 'openGym is on your Apple Watch': 'มี openGym บน Apple Watch แล้ว',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'ไม่ได้รับอนุญาตบนนาฬิกา อนุญาตได้ในแอปสุขภาพบน iPhone',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'อัตราการเต้นของหัวใจระหว่างฝึกและข้างแต่ละเซ็ต และบันทึกการฝึกลงในสุขภาพ นาฬิกาจะถามครั้งเดียว',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 7b892cb30..cf4f2e1c5 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': 'Tamamlanan egzersizleri atla',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Bu uygulama geçiş anahtarıyla onaylayamaz. Kodu bu profille oturum açmış bir tarayıcıda oluştur ya da önce orada bir parola ekle.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Ağırlık',+ 'Send workouts to the watch': 'Antrenmanları saate gönder',+ 'Apple Health on the watch': 'Saatte Sağlık',+ 'Tap the wrist when a rest is over': 'Dinlenme bitince bileğe dokun',+ 'The Digital Crown turns first': 'Digital Crown önce bunu değiştirir',+ 'No Apple Watch paired with this iPhone': 'Bu iPhone ile eşlenmiş Apple Watch yok',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym henüz Apple Watch’unda değil. Watch uygulamasından yükle.',+ 'openGym is on your Apple Watch': 'openGym Apple Watch’unda',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'Saatte izin verilmedi. iPhone’undaki Sağlık uygulamasından izin ver.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Antrenman sırasında ve her setin yanında nabız, antrenman Sağlık’a kaydedilir. Saat bir kez sorar.',}diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.jsindex b5480605a..452d734ad 100644--- a/frontend/src/locales/uk.js+++ b/frontend/src/locales/uk.js@@ -2352,4 +2352,16 @@ export default {'Skip completed exercises': 'Пропускати виконані вправи',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': 'Цей застосунок не може підтвердити ключем доступу. Створіть код у браузері, де ви ввійшли в цей профіль, або спершу задайте там пароль.',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': 'Вага',+ 'Send workouts to the watch': 'Надсилати тренування на годинник',+ 'Apple Health on the watch': 'Здоровʼя на годиннику',+ 'Tap the wrist when a rest is over': 'Дотик до зап’ястя в кінці відпочинку',+ 'The Digital Crown turns first': 'Digital Crown спершу змінює',+ 'No Apple Watch paired with this iPhone': 'До цього iPhone не під’єднано Apple Watch',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': 'openGym ще немає на твоєму Apple Watch. Установи його в програмі Watch.',+ 'openGym is on your Apple Watch': 'openGym є на твоєму Apple Watch',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': 'На годиннику не дозволено. Дозволь у програмі «Здоров’я» на iPhone.',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': 'Пульс під час тренування і біля кожного підходу, тренування зберігається у «Здоров’ї». Годинник спитає один раз.',}diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.jsindex b72a71771..e5605cf83 100644--- a/frontend/src/locales/zh-TW.js+++ b/frontend/src/locales/zh-TW.js@@ -2348,4 +2348,16 @@ export default {'Skip completed exercises': '跳過已完成的動作',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': '此 App 無法以通行密鑰確認。請在已登入此個人檔案的瀏覽器中產生代碼,或先在那裡設定密碼。',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': '重量',+ 'Send workouts to the watch': '把訓練傳送到手錶',+ 'Apple Health on the watch': '手錶上的「健康」',+ 'Tap the wrist when a rest is over': '休息結束時輕點手腕',+ 'The Digital Crown turns first': '數位錶冠先調整',+ 'No Apple Watch paired with this iPhone': '沒有與這台 iPhone 配對的 Apple Watch',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': '你的 Apple Watch 上還沒有 openGym。請在 Watch App 中安裝。',+ 'openGym is on your Apple Watch': 'openGym 已在你的 Apple Watch 上',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': '手錶上未獲允許。請在 iPhone 的「健康」App 中允許。',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': '訓練中及每組旁的心率,以及儲存到「健康」的訓練。手錶只會詢問一次。',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex f1f61ea5d..40f0e37e0 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -2355,4 +2355,16 @@ export default {'Skip completed exercises': '跳过已完成的动作',// --- #551 device link from the phone ---'This app can’t confirm with a passkey. Make the code in a browser signed in to this profile, or add a password there first.': '此应用无法用通行密钥确认。请在已登录此档案的浏览器中生成代码,或先在那里设置密码。',+ // --- Settings → Apple Watch ---+ 'Apple Watch': 'Apple Watch',+ 'Weight': '重量',+ 'Send workouts to the watch': '把训练发送到手表',+ 'Apple Health on the watch': '手表上的“健康”',+ 'Tap the wrist when a rest is over': '休息结束时轻敲手腕',+ 'The Digital Crown turns first': '数码表冠先调节',+ 'No Apple Watch paired with this iPhone': '没有与这台 iPhone 配对的 Apple Watch',+ 'openGym is not on your Apple Watch yet. Install it in the Watch app.': '你的 Apple Watch 上还没有 openGym。请在 Watch App 中安装。',+ 'openGym is on your Apple Watch': 'openGym 已在你的 Apple Watch 上',+ 'Not allowed on the watch. Allow it in the Health app on your iPhone.': '手表上未获允许。请在 iPhone 的“健康”App 中允许。',+ 'Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.': '训练中及每组旁的心率,以及保存到“健康”的训练。手表只会询问一次。',}diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 2c044be3f..73502e0dc 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -48,6 +48,7 @@ import { DeleteAccountRow } from '../components/DeleteAccount.jsx'import { Section, Row, SelectRow, Switch, Segmented, Button, TextField, SearchField } from '../components/ui.jsx'import { PAGES, ROOT_GROUPS, pageVisible, searchSettings, pageTrail } from './settings-pages.js'import { pathBefore } from '../lib/nav.js'+import WatchSettingsPage from './WatchSettings.jsx'/* Settings (v1.3.11). The root is one screen: an account card, eleven rows that each open a page(/settings/<page>), and a search over every row. Rare things live one level further down@@ -156,6 +157,7 @@ export default function Settings({ page = null, find = null, via = null, entryKe// --- update check state ---const [updateInfo, setUpdateInfo] = useState(null) // { hasUpdate, latestVersion, apkUrl, hashUrl } | nullconst [android, setAndroid] = useState(false)+ const [ios, setIos] = useState(false) // the iPhone app: Settings → Apple Watchconst [selfUpdate, setSelfUpdate] = useState(false) // the sideloaded APK, which updates itselfconst [checking, setChecking] = useState(false)// Where auto-backup writes on this Android phone, for the Auto-backup row's own subtitle.@@ -171,6 +173,7 @@ export default function Settings({ page = null, find = null, via = null, entryKeif (!MOBILE) returnisAndroid().then(async ok => {setAndroid(ok)+ setIos(!ok)const own = ok && await selfUpdates()setSelfUpdate(own)if (own && page === 'about') checkForUpdate().then(setUpdateInfo).catch(() => {})@@ -402,7 +405,7 @@ export default function Settings({ page = null, find = null, via = null, entryKe/* ---------------- what the pages and the search need to know about this device ---------------- */const canVibrate = vibrateSupported()const ctx = {- user, mobile: MOBILE, android, demo: DEMO, wakeOK, hasMedia, pwOn, webauthn: webauthnOK(),+ user, mobile: MOBILE, android, ios: MOBILE && ios, demo: DEMO, wakeOK, hasMedia, pwOn, webauthn: webauthnOK(),sound: !!S.sound, playOnSilent: playOnSilentSupported(), canVibrate, vibrate: S.vibrate !== false,profiles: (S.equipProfiles || []).length > 0, nameLang: EXERCISE_NAME_LANGS.includes(baseLang(lang)),pushOK: !MOBILE && pushSupported(), reminderOn: !!S.reminder?.on, nudge: !!S.reminder?.nudge,@@ -425,6 +428,7 @@ export default function Settings({ page = null, find = null, via = null, entryKecoach: () => (coachLocal?.mode === 'server' ? t('Your server') : coachLocal?.mode === 'byok' ? t('Your API key') : t('Off')),data: () => '',about: () => 'v' + __APP_VERSION__,+ watch: () => '',}const open = id => {@@ -458,6 +462,7 @@ export default function Settings({ page = null, find = null, via = null, entryKe})} />const pages = {+ watch: () => <WatchSettingsPage />,workout: () => <><Section title={t('Rest')} footer={t('Each exercise can have its own rest too. Set it in the exercise settings of a routine.')}>{restRow}diff --git a/frontend/src/views/WatchSettings.jsx b/frontend/src/views/WatchSettings.jsxnew file mode 100644index 000000000..15289093d--- /dev/null+++ b/frontend/src/views/WatchSettings.jsx@@ -0,0 +1,46 @@+// Settings → Apple Watch (iPhone app only): whether the watch app is there, and this phone's+// choices for it (lib/watch-settings.js), which the watch gets with every snapshot.+import { useEffect, useState } from 'react'+import { t } from '../lib/i18n.js'+import { Section, Row, Switch, SelectRow } from '../components/ui.jsx'+import { readWatchPrefs, writeWatchPrefs, readWatchStatus, onWatchPrefs } from '../lib/watch-settings.js'+import { watchStatus } from '../lib/watch-sync.js'++export default function WatchSettingsPage() {+ const [prefs, setPrefs] = useState(readWatchPrefs)+ const [status, setStatus] = useState(readWatchStatus)+ const [link, setLink] = useState(null) // { paired, installed } from the phone, or null while asking+ useEffect(() => onWatchPrefs(() => { setPrefs(readWatchPrefs()); setStatus(readWatchStatus()) }), [])+ useEffect(() => { watchStatus().then(setLink).catch(() => setLink({ paired: false, installed: false })) }, [])+ const set = patch => setPrefs(writeWatchPrefs(patch))++ const linkLine = !link ? t('Checking…')+ : !link.paired ? t('No Apple Watch paired with this iPhone')+ : !link.installed ? t('openGym is not on your Apple Watch yet. Install it in the Watch app.')+ : t('openGym is on your Apple Watch')+ const healthLine = status?.health === 'denied' ? t('Not allowed on the watch. Allow it in the Health app on your iPhone.')+ : t('Heart rate during the workout and next to each set, and the workout saved to Apple Health. The watch asks once.')++ return <>+ <Section footer={linkLine}>+ <Row icon="watch" iconTint="var(--grey)" title={t('Send workouts to the watch')}>+ <Switch checked={prefs.enabled} onChange={v => set({ enabled: v })} aria-label={t('Send workouts to the watch')} />+ </Row>+ </Section>+ {prefs.enabled && <>+ <Section footer={healthLine}>+ <Row icon="heart" iconTint="var(--red)" title={t('Apple Health on the watch')}>+ <Switch checked={prefs.health} onChange={v => set({ health: v })} aria-label={t('Apple Health on the watch')} />+ </Row>+ </Section>+ <Section>+ <Row icon="vibrate" iconTint="var(--indigo)" title={t('Tap the wrist when a rest is over')}>+ <Switch checked={prefs.restHaptics} onChange={v => set({ restHaptics: v })} aria-label={t('Tap the wrist when a rest is over')} />+ </Row>+ <SelectRow icon="stopwatch" iconTint="var(--orange)" title={t('The Digital Crown turns first')} value={prefs.crown}+ onChange={v => set({ crown: v })}+ options={[{ value: 'reps', label: t('Reps') }, { value: 'weight', label: t('Weight') }]} />+ </Section>+ </>}+ </>+}diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.jsindex ef9c4c6c1..861680da1 100644--- a/frontend/src/views/settings-pages.js+++ b/frontend/src/views/settings-pages.js@@ -17,6 +17,7 @@ export const PAGES = {equipment: { title: 'Equipment', icon: 'kettlebell', tint: 'var(--indigo)' },look: { title: 'Look & Home', icon: 'palette', tint: 'var(--purple)' },coach: { title: 'AI Coach', icon: 'sparkles', tint: 'var(--green)' },+ watch: { title: 'Apple Watch', icon: 'watch', tint: 'var(--grey)' },data: { title: 'Data & backup', icon: 'folder', tint: 'var(--blue)' },about: { title: 'About & updates', icon: 'info', tint: 'var(--grey)' },account: { title: 'Account', icon: 'personCircle', tint: 'var(--grey)' },@@ -25,7 +26,7 @@ export const PAGES = {export const PAGE_IDS = Object.keys(PAGES)// The root, top to bottom. Whether a row shows is pageVisible's call.-export const ROOT_GROUPS = [['workout', 'alerts', 'reminders'], ['plan', 'units', 'equipment'], ['look', 'coach'], ['data', 'about']]+export const ROOT_GROUPS = [['workout', 'alerts', 'reminders'], ['plan', 'units', 'equipment'], ['look', 'coach', 'watch'], ['data', 'about']]/*** Whether a page exists for this device and profile. Reminders need a push server (signed in) or@@ -35,6 +36,8 @@ export const ROOT_GROUPS = [['workout', 'alerts', 'reminders'], ['plan', 'units'export function pageVisible(page, ctx) {if (page === 'reminders') return !!(ctx.user || ctx.mobile)if (page === 'coach') return !!ctx.mobile+ // The iPhone app only: the watch app ships inside it.+ if (page === 'watch') return !!ctx.iosreturn page in PAGES}