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
Follow-up to !36: Arabic covers the sync, plan, workout-editor and demo strings, the connection line and the swipes on the workout card and routine rows mirror in right-to-left, and rebuilding the instruction packs no longer empties the Arabic one
Duarte Santos609ae0ee1fcd
diff --git a/frontend/src/components/SwipeCards.jsx b/frontend/src/components/SwipeCards.jsxindex b6d930683..723a40674 100644--- a/frontend/src/components/SwipeCards.jsx+++ b/frontend/src/components/SwipeCards.jsx@@ -7,6 +7,12 @@ const COMMIT_DISTANCE = 70const GAP = 12const DURATION = 200+// Which physical side the next card lies on: the right in a left-to-right language, the left in+// a right-to-left one (Arabic), where the exercises run from right to left like the text. A+// swipe towards the other side brings the next card in. `direction` stays logical throughout+// (+1 next, -1 previous) and only the pixels are multiplied by this.+const nextSide = () => (typeof document !== 'undefined' && document.documentElement.dir === 'rtl' ? -1 : 1)+export default function SwipeCards({ children, renderPreview, onNavigate, index, count, revision, timerKey, workKey }) {const surface = useRef(null)const card = useRef(null)@@ -18,13 +24,14 @@ export default function SwipeCards({ children, renderPreview, onNavigate, index,latest.current = { revision, timerKey, workKey }const paint = (offset, animate = false, toward = gesture.current?.direction) => {+ const side = gesture.current?.side ?? nextSide()if (card.current) {card.current.style.transition = animate ? `transform ${DURATION}ms ease-out` : 'none'card.current.style.transform = `translateX(${offset}px)`}if (preview.current && toward) {preview.current.style.transition = animate ? `transform ${DURATION}ms ease-out` : 'none'- const start = toward > 0 ? '100% + ' : '-100% - '+ const start = toward * side > 0 ? '100% + ' : '-100% - 'preview.current.style.transform = `translateX(calc(${start}${GAP}px + ${offset}px))`}}@@ -59,6 +66,7 @@ export default function SwipeCards({ children, renderPreview, onNavigate, index,y: event.clientY,offset: 0,direction: null,+ side: nextSide(),revision,timerKey,workKey,@@ -79,7 +87,7 @@ export default function SwipeCards({ children, renderPreview, onNavigate, index,event.currentTarget.setPointerCapture?.(event.pointerId)}- const nextDirection = dx < 0 ? 1 : -1+ const nextDirection = dx * active.side < 0 ? 1 : -1const available = index + nextDirection >= 0 && index + nextDirection < countactive.direction = nextDirectionactive.offset = available ? dx : dx * 0.35@@ -107,7 +115,7 @@ export default function SwipeCards({ children, renderPreview, onNavigate, index,if (navigate) onNavigate(completedDirection)}- paint(commit ? -active.direction * (width + GAP) : 0, !reducedMotion, active.direction)+ paint(commit ? -active.direction * active.side * (width + GAP) : 0, !reducedMotion, active.direction)if (reducedMotion) complete()else pending.current = setTimeout(complete, DURATION)}diff --git a/frontend/src/components/SwipeCards.test.jsx b/frontend/src/components/SwipeCards.test.jsxindex 62a17ae7f..4dfa0b674 100644--- a/frontend/src/components/SwipeCards.test.jsx+++ b/frontend/src/components/SwipeCards.test.jsx@@ -138,4 +138,35 @@ describe('SwipeCards', () => {act(() => vi.advanceTimersByTime(201))expect(props.onNavigate).toHaveBeenCalledExactlyOnceWith(1)})++ // In Arabic the exercises run from right to left like the text, so the next card lies to the+ // left and comes in with a swipe to the right — the mirror of every gesture above.+ describe('right to left', () => {+ beforeEach(() => { document.documentElement.dir = 'rtl' })+ afterEach(() => { document.documentElement.dir = '' })++ it('a swipe to the right brings the next card in from the left', () => {+ props = { ...props, index: 1 }+ render()+ pointer('pointerdown', 100)+ pointer('pointermove', 250)+ const preview = host.querySelector('.workout-swipe-preview')+ expect(preview.textContent).toContain('Adjacent 1')+ expect(preview.style.transform).toContain('-100%')+ pointer('pointerup', 250)+ act(() => vi.advanceTimersByTime(201))+ expect(props.onNavigate).toHaveBeenCalledExactlyOnceWith(1)+ })++ it('a swipe to the left goes back to the previous card', () => {+ props = { ...props, index: 1 }+ render()+ pointer('pointerdown', 250)+ pointer('pointermove', 100)+ expect(host.querySelector('.workout-swipe-preview').textContent).toContain('Adjacent -1')+ pointer('pointerup', 100)+ act(() => vi.advanceTimersByTime(201))+ expect(props.onNavigate).toHaveBeenCalledExactlyOnceWith(-1)+ })+ })})diff --git a/frontend/src/components/SwipeToDelete.jsx b/frontend/src/components/SwipeToDelete.jsxindex 4a5e89018..148b50b76 100644--- a/frontend/src/components/SwipeToDelete.jsx+++ b/frontend/src/components/SwipeToDelete.jsx@@ -32,7 +32,12 @@ import { t } from '../lib/i18n.js'// button sits in the tab order right before its row but under it on screen, so focusing it// slides the row open the way a swipe would, and moving focus on closes it again: otherwise// Tab would land on a button nobody can see.+//+// The button sits at the row's inline end: the right in a left-to-right language, the left in+// Arabic. Offsets below are kept in that logical sense (negative = towards the start, opening)+// and turned into pixels only in setX, so one gesture reads the same in both directions.const REVEAL = 76+const endSide = () => (document.documentElement.dir === 'rtl' ? -1 : 1)export default function SwipeToDelete({ children, onDelete, deleteLabel, className, onClick, role, tabIndex, onKeyDown }) {const outerRef = useRef(null)const rowRef = useRef(null)@@ -45,7 +50,7 @@ export default function SwipeToDelete({ children, onDelete, deleteLabel, classNaconst el = rowRef.currentif (!el) returnel.style.transition = animate ? 'transform .18s ease-out' : 'none'- el.style.transform = `translateX(${x}px)`+ el.style.transform = `translateX(${x * endSide()}px)`}const start = (x, y) => { drag.current = { startX: x, startY: y, delta: 0, open: drag.current.open, axis: null } }const move = (x, y, ev) => {@@ -58,7 +63,7 @@ export default function SwipeToDelete({ children, onDelete, deleteLabel, classNa}if (d.axis === 'y') returnev?.preventDefault?.()- d.delta = dx+ d.delta = dx * endSide()const base = d.open ? -REVEAL : 0setX(Math.max(-REVEAL - 12, Math.min(0, base + dx)), false)}@@ -89,7 +94,7 @@ export default function SwipeToDelete({ children, onDelete, deleteLabel, classNaonMouseUp={end}onMouseLeave={() => { if (drag.current.startX !== null) end() }}><button className="swipe-del" aria-label={deleteLabel || t('Delete')}- style={{ position: 'absolute', inset: '0 0 0 auto', width: REVEAL, background: 'var(--red)', color: '#fff', fontSize: 12, fontWeight: 600 }}+ style={{ position: 'absolute', top: 0, bottom: 0, insetInlineEnd: 0, width: REVEAL, background: 'var(--red)', color: '#fff', fontSize: 12, fontWeight: 600 }}onFocus={() => { if (drag.current.open) return; focusOpened.current = true; drag.current.open = true; setX(-REVEAL, true) }}onBlur={() => { if (!focusOpened.current) return; focusOpened.current = false; drag.current.open = false; setX(0, true) }}onClick={() => { setX(0, true); drag.current.open = false; onDelete() }}>{t('Delete')}</button>diff --git a/frontend/src/index.css b/frontend/src/index.cssindex 0939eff85..630eb3d5f 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -182,15 +182,15 @@ body.resting #app{padding-bottom:calc(206px + var(--sab))}tab bar (50), the timer and every sheet. The sentence is never cut: its last words are the onesthat say the changes are kept, so a narrow phone gets a third line rather than an ellipsis. */.conn-bar{- position:fixed;left:0;right:0;top:0;z-index:45;+ position:fixed;inset-inline-start:0;inset-inline-end:0;top:0;z-index:45;padding:var(--sat) var(--pad) 0;background:color-mix(in srgb,var(--bg) 94%,transparent);-webkit-backdrop-filter:saturate(180%) blur(10px);backdrop-filter:saturate(180%) blur(10px);}.conn-row{max-width:560px;margin:0 auto;padding:6px 0}.conn{- display:flex;align-items:center;gap:9px;width:100%;text-align:left;min-height:34px;- padding:6px 8px 6px 12px;border-radius:var(--r);+ display:flex;align-items:center;gap:9px;width:100%;text-align:start;min-height:34px;+ padding-block:6px;padding-inline:12px 8px;border-radius:var(--r);background:color-mix(in srgb,var(--yellow) 16%,var(--surface));color:var(--label);font-size:13px;line-height:1.3;}.conn .icn{flex:none;font-size:16px;color:var(--label-2)}@@ -202,7 +202,7 @@ button.conn:active{filter:brightness(1.12)}.conn-bar.bad .conn .icn{color:var(--red)}/* a deliberate local setup: said, not flagged — one small line, no fill */.conn-bar.quiet .conn-row{padding:2px 0 4px}-.conn-bar.quiet .conn{min-height:26px;padding:2px 2px 2px 4px;background:none;color:var(--label-2);font-size:12px;gap:6px}+.conn-bar.quiet .conn{min-height:26px;padding-block:2px;padding-inline:4px 2px;background:none;color:var(--label-2);font-size:12px;gap:6px}.conn-bar.quiet .conn .icn{font-size:13px;color:var(--label-3)}.conn-bar.quiet .conn-a{padding:2px 9px;font-size:12px;color:var(--acc);background:var(--acc-soft)}:root[data-theme="light"] .conn-bar:not(.quiet) .conn-a{background:var(--surface)}@@ -1353,7 +1353,7 @@ body.chips-dragging *{cursor:inherit}.workout-swipe-stack{position:relative;isolation:isolate;overflow:hidden}.workout-swipe-stack>.workout-swipe-card,.workout-swipe-stack>.workout-swipe-preview{min-width:0}.workout-swipe-card{position:relative;z-index:2;background:var(--bg)}-.workout-swipe-preview{position:absolute;z-index:1;inset:0 auto auto 0;width:100%;pointer-events:none;background:var(--bg)}+.workout-swipe-preview{position:absolute;z-index:1;top:0;inset-inline-start:0;width:100%;pointer-events:none;background:var(--bg)}/* A superset nests a card inside the page's own gutter, so its inset is paid twice. On anarrow phone that left the weight and reps steppers too tight to show a three-digitnumber — reported as "the reps textbox becomes too small when superset on mobile". Thediff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.jsindex 71212a7b0..366bc99a7 100644--- a/frontend/src/locales/ar.js+++ b/frontend/src/locales/ar.js@@ -280,12 +280,9 @@ export default {'Passkeys use {0} — no passwords.': 'تستخدم مفاتيح المرور {0} — لا حاجة لكلمات مرور.','Each profile keeps its own plan, workouts & body weight.': 'يحتفظ كل ملف شخصي بخطته وتمارينه ووزن جسمه.','Account': 'الحساب',- 'Signed in with passkey — data syncs to this profile.': 'تم تسجيل الدخول بمفتاح المرور — تتم مزامنة البيانات مع هذا الملف الشخصي.','Sign out?': 'تسجيل الخروج؟',- 'Your data is synced to your profile first, then cleared from this device.': 'تتم مزامنة بياناتك مع ملفك الشخصي أولاً، ثم تُمسح من هذا الجهاز.','Sign out': 'تسجيل الخروج','Sign out everywhere?': 'تسجيل الخروج من كل الأجهزة؟',- 'Signs this profile out on every device, including this one. Your passkeys keep working — sign in with them again anytime.': 'يسجّل خروج هذا الملف الشخصي من كل الأجهزة، بما فيها هذا الجهاز. تبقى مفاتيح المرور الخاصة بك تعمل — سجّل الدخول بها مجدداً في أي وقت.','Sign out everywhere': 'تسجيل الخروج من كل الأجهزة','Ends this profile’s sessions on all your devices.': 'ينهي جلسات هذا الملف الشخصي على جميع أجهزتك.','Signed out on all devices': 'تم تسجيل الخروج من جميع الأجهزة',@@ -325,8 +322,8 @@ export default {'Backup imported': 'تم استيراد النسخة الاحتياطية','Import failed: {0}': 'تعذّر الاستيراد: {0}','Tip': 'نصيحة',- 'In Chrome: ⋮ menu → Add to Home screen': 'في Chrome: قائمة ⋮ → إضافة إلى الشاشة الرئيسية',- 'In Safari: Share → Add to Home Screen': 'في Safari: مشاركة → إضافة إلى الشاشة الرئيسية',+ 'In Chrome: ⋮ menu → Add to Home screen': 'في Chrome: قائمة ⋮ ← إضافة إلى الشاشة الرئيسية',+ 'In Safari: Share → Add to Home Screen': 'في Safari: مشاركة ← إضافة إلى الشاشة الرئيسية','to install openGym as a full-screen app.': 'لتثبيت openGym كتطبيق بملء الشاشة.','Your data syncs with your profile — sign in anywhere to see it.': 'تتزامن بياناتك مع ملفك الشخصي — سجّل الدخول من أي مكان لرؤيتها.','Guest data stays on this device — export a backup now and then!': 'بيانات الضيف تبقى على هذا الجهاز — صدّر نسخة احتياطية من حين لآخر!',@@ -692,11 +689,8 @@ export default {'Primary muscle groups': 'المجموعات العضلية الأساسية','Additional muscle groups': 'المجموعات العضلية الإضافية','No explicit muscle group': 'بدون مجموعة عضلية محددة',- 'Your server': 'خادمك',- 'Synced with your openGym server.': 'متزامن مع خادم openGym الخاص بك.','Disconnect': 'قطع الاتصال','Disconnect from your server?': 'قطع الاتصال بخادمك؟',- 'Your data is synced to your server first, then this device switches back to local-only.': 'تُزامن بياناتك مع خادمك أولًا، ثم يعود هذا الجهاز إلى الوضع المحلي فقط.','Disconnected — back to local-only': 'تم قطع الاتصال — عدت إلى الوضع المحلي','Connect to my server': 'الاتصال بخادمي','Sync this device to your own self-hosted openGym instead.': 'زامن هذا الجهاز مع نسخة openGym المستضافة ذاتيًا بدلًا من ذلك.',@@ -1305,4 +1299,123 @@ export default {'No bar': 'بدون بار','The weight you log is all plates.': 'الوزن الذي تسجله كله أقراص.','Plates are counted from 0 — turn this off for the default ({0}).': 'تُحتسب الأقراص من 0 — أوقف هذا للعودة إلى الافتراضي ({0}).',+ // --- added since the pack was first written: sync, plan, workout editor, demo ---+ 'Less volume': 'حجم أقل',+ 'More volume': 'حجم أكبر',+ 'English exercise names': 'أسماء التمارين بالإنجليزية',+ 'Show the English name in parentheses next to the translated one.': 'إظهار الاسم الإنجليزي بين قوسين بجانب الاسم المترجم.',+ 'English names only': 'الأسماء الإنجليزية فقط',+ 'Replace the translated names with the original English ones.': 'يستبدل الأسماء المترجمة بالأسماء الإنجليزية الأصلية.',+ 'This device is out of storage: the change is not saved on it. Signed in, it still goes to the server.': 'لا توجد مساحة تخزين كافية على هذا الجهاز: لم يُحفظ التغيير عليه. إذا كنت مسجّل الدخول، فسيصل إلى الخادم رغم ذلك.',+ 'Enter the endpoint URL': 'أدخل عنوان URL لنقطة النهاية',+ 'There is no routine to review yet — build one with at least two exercises first.': 'لا يوجد روتين لمراجعته بعد — أنشئ روتينًا يضم تمرينين على الأقل أولًا.',+ 'Change date & time': 'تغيير التاريخ والوقت',+ 'Workout moved': 'نُقل التمرين',+ 'Change duration': 'تغيير المدة',+ 'Duration changed': 'تم تغيير المدة',+ 'Forgot to finish on time? Set how long the session really took. It keeps its start time and its sets.': 'نسيت الإنهاء في الوقت المناسب؟ حدّد المدة الفعلية للجلسة. يبقى وقت بدئها ومجموعاتها كما هي.',+ 'The session keeps its length. Personal records are worked out again from the new order.': 'تحتفظ الجلسة بمدتها. يُعاد حساب الأرقام القياسية الشخصية وفق الترتيب الجديد.',+ 'Show the body weight card on Home.': 'يعرض بطاقة وزن الجسم في الرئيسية.',+ 'This phone is not connected to a server.': 'هذا الهاتف غير متصل بأي خادم.',+ 'The server did not answer in time.': 'لم يستجب الخادم في الوقت المحدد.',+ 'The server answered with something other than openGym data.': 'ردّ الخادم بشيء ليس بيانات openGym.',+ 'All synced': 'تمت مزامنة كل شيء',+ 'Waiting to sync': 'بانتظار المزامنة',+ 'Offline — the server cannot be reached': 'غير متصل — تعذّر الوصول إلى الخادم',+ 'Not an openGym answer (HTTP {0})': 'ليس ردًّا من openGym (HTTP {0})',+ 'Your server’s address answered with something other than openGym (HTTP {0}). Your changes are kept here.': 'ردّ عنوان خادمك بشيء غير openGym (HTTP {0}). تغييراتك محفوظة هنا.',+ 'Server error (HTTP {0})': 'خطأ في الخادم (HTTP {0})',+ 'Your server answered with an error (HTTP {0}). Your changes are kept here.': 'ردّ خادمك بخطأ (HTTP {0}). تغييراتك محفوظة هنا.',+ 'The server refuses this browser': 'الخادم يرفض هذا المتصفح',+ 'Your server no longer accepts this browser. Your changes are kept here.': 'لم يعد خادمك يقبل هذا المتصفح. تغييراتك محفوظة هنا.',+ 'This phone is no longer paired with your server. Your changes are kept here.': 'لم يعد هذا الهاتف مقترنًا بخادمك. تغييراتك محفوظة هنا.',+ 'The server refuses this phone': 'الخادم يرفض هذا الهاتف',+ 'Your server no longer accepts this phone. Your changes are kept here.': 'لم يعد خادمك يقبل هذا الهاتف. تغييراتك محفوظة هنا.',+ 'On this phone only — not connected to a server': 'على هذا الهاتف فقط — غير متصل بخادم',+ 'Pair again': 'الإقران مجددًا',+ 'Sign in': 'تسجيل الدخول',+ 'Disconnect anyway': 'قطع الاتصال على أي حال',+ 'Sign out anyway': 'تسجيل الخروج على أي حال',+ 'Could not keep a copy of the changes on this device — nothing was removed.': 'تعذّر الاحتفاظ بنسخة من التغييرات على هذا الجهاز — لم يُحذف شيء.',+ 'Not everything is on your server yet': 'ليس كل شيء على خادمك بعد',+ 'Not on your server yet: {0}': 'ليست على خادمك بعد: {0}',+ 'Some changes on this device have not reached your server.': 'بعض التغييرات على هذا الجهاز لم تصل إلى خادمك.',+ 'Try again, or export a backup first. Going ahead anyway keeps a copy of these changes on this device until it connects to this server as this account again — then they are added back.': 'حاول مجددًا، أو صدّر نسخة احتياطية أولًا. إذا تابعت على أي حال، فستبقى نسخة من هذه التغييرات على هذا الجهاز حتى يتصل بهذا الخادم بهذا الحساب مجددًا — وعندها تُضاف من جديد.',+ 'Syncing…': 'جارٍ المزامنة…',+ 'Try again': 'حاول مجددًا',+ 'Last synced: {0}': 'آخر مزامنة: {0}',+ 'Not synced with this server yet': 'لم تتم المزامنة مع هذا الخادم بعد',+ 'Server & sync': 'الخادم والمزامنة',+ 'Signed in as {0}': 'مسجّل الدخول باسم {0}',+ 'Sync now': 'زامِن الآن',+ 'Your changes are kept here, and merged into your account once it is paired again.': 'تغييراتك محفوظة هنا، وستُدمج في حسابك بمجرد إقرانه مجددًا.',+ 'Your changes are kept here, and merged into your account once you are signed in again.': 'تغييراتك محفوظة هنا، وستُدمج في حسابك بمجرد تسجيل دخولك مجددًا.',+ 'Changes kept for {0}': 'تغييرات محفوظة لـ {0}',+ 'Added back when this device connects as that account again.': 'تُضاف من جديد عندما يتصل هذا الجهاز بذلك الحساب مجددًا.',+ 'The changes your server has not seen are kept on this device, and added back when it connects as this account again.': 'التغييرات التي لم يرها خادمك محفوظة على هذا الجهاز، وتُضاف من جديد عندما يتصل بهذا الحساب مجددًا.',+ 'This phone switches back to local-only and its copy of your account is removed. First it checks that your server has every change — if not, you choose what happens to them.': 'يعود هذا الهاتف إلى الوضع المحلي فقط وتُحذف نسخة حسابك منه. يتحقق أولًا من أن خادمك لديه كل التغييرات — وإن لم يكن، فأنت تختار ما يحدث لها.',+ 'Your data is removed from this browser; your profile on the server keeps it. First it checks that the server has every change — if not, you choose what happens to them.': 'تُحذف بياناتك من هذا المتصفح؛ ويحتفظ بها ملفك الشخصي على الخادم. يتحقق أولًا من أن الخادم لديه كل التغييرات — وإن لم يكن، فأنت تختار ما يحدث لها.',+ 'Signs this profile out on every device, including this one. Phones paired with it are disconnected and have to be paired again. Your passkeys keep working — sign in with them again anytime.': 'يسجّل خروج هذا الملف الشخصي من كل الأجهزة، بما فيها هذا الجهاز. تُفصل الهواتف المقترنة به ويجب إقرانها مجددًا. تظل مفاتيح المرور تعمل — سجّل الدخول بها مجددًا في أي وقت.',+ 'Open Settings → “Pair the mobile app” on your openGym site in a browser and enter the new code shown there. What this phone kept is merged into your account.': 'افتح الإعدادات ← «إقران تطبيق الجوال» في موقع openGym الخاص بك من متصفح وأدخل الرمز الجديد الظاهر هناك. ما احتفظ به هذا الهاتف يُدمج في حسابك.',+ '{0} change': '{0} تغيير',+ '{0} changes': '{0} تغييرات',+ 'Planned sessions start from': 'نقطة بدء الجلسات المخطط لها',+ 'The routine’s sets and reps. Your history decides the weight.': 'مجموعات الروتين وتكراراته. سجلّك يحدد الوزن.',+ 'Your last session': 'جلستك الأخيرة',+ 'The reps you logged last time in that routine, carried over.': 'تُنقل التكرارات التي سجّلتها آخر مرة في ذلك الروتين.',+ 'Plan changed — starting from your new target.': 'تغيّرت الخطة — نبدأ من هدفك الجديد.',+ 'First time in this routine — starting from its own target.': 'أول مرة في هذا الروتين — نبدأ من هدفه الخاص.',+ 'No weight logged last time — enter what you lift and progression takes it from there.': 'لم يُسجَّل وزن في المرة الماضية — أدخل الوزن الذي ترفعه وسيتابع التقدم من هناك.',+ 'Plan: {0}': 'الخطة: {0}',+ 'today {0}': 'اليوم {0}',+ 'reps from your last session': 'تكرارات من جلستك الأخيرة',+ 'Save as routine?': 'الحفظ كروتين؟',+ 'Save as routine': 'حفظ كروتين',+ 'Create an independent routine from these exercise targets. Your workout history is kept.': 'إنشاء روتين مستقل من أهداف التمارين هذه. يبقى سجل تمارينك محفوظًا.',+ 'Pause': 'إيقاف مؤقت',+ 'Keep timing after target': 'متابعة التوقيت بعد الهدف',+ 'Timed sets continue up to 15 extra minutes. Tap Done to log the actual duration.': 'تستمر المجموعات الموقوتة حتى 15 دقيقة إضافية. اضغط «تم» لتسجيل المدة الفعلية.',+ 'Edit workout': 'تعديل التمرين',+ 'Workout updated': 'تم تحديث التمرين',+ 'Save workout changes?': 'حفظ تغييرات التمرين؟',+ 'Save your edits to this workout, or keep the original record.': 'احفظ تعديلاتك على هذا التمرين، أو احتفظ بالسجل الأصلي.',+ 'Save changes': 'حفظ التغييرات',+ "Don't save": 'عدم الحفظ',+ 'Keep editing': 'متابعة التعديل',+ 'This workout was deleted on another device. Your edits are still here.': 'حُذف هذا التمرين على جهاز آخر. تعديلاتك لا تزال هنا.',+ 'Close editor': 'إغلاق المحرر',+ 'Editing a saved workout. Date and duration stay unchanged.': 'تعديل تمرين محفوظ. يبقى التاريخ والمدة دون تغيير.',+ 'A pull for every press, so the shoulders stay balanced.': 'تمرين سحب مقابل كل تمرين دفع، ليبقى الكتفان متوازنين.',+ 'A two-day rotation across three sessions a week, built around the equipment you listed. Compounds first, one pull for every press, and enough overlap between the days that nothing goes two weeks without being trained.': 'تناوب بين يومين على ثلاث جلسات أسبوعيًا، مبني حول المعدات التي حددتها. التمارين المركبة أولًا، وتمرين سحب مقابل كل تمرين دفع، وتداخل كافٍ بين اليومين حتى لا يمر أسبوعان على أي عضلة دون تدريب.',+ 'Based on the training already in this demo profile.': 'بناءً على التدريب الموجود مسبقًا في ملف العرض التجريبي هذا.',+ 'Body weight has been flat for four weeks while the goal is to gain. That is a kitchen problem rather than a training one — the plan is not what is holding it back.': 'وزن الجسم ثابت منذ أربعة أسابيع بينما الهدف هو الزيادة. هذه مشكلة مطبخ لا مشكلة تدريب — ليست الخطة هي ما يعيقه.',+ 'Demo': 'عرض تجريبي',+ 'Demo data reset': 'أُعيد تعيين بيانات العرض التجريبي',+ 'Direct arm work, since you asked for it.': 'تمرين مباشر للذراعين، بناءً على طلبك.',+ 'Every top set on this one came in at RPE 9.5 or above for three sessions and the weight has not moved. Swapping the movement for four weeks usually breaks that stall faster than grinding the same one.': 'جاءت كل المجموعات الأثقل في هذا التمرين عند RPE 9.5 أو أعلى لثلاث جلسات ولم يتحرك الوزن. استبدال الحركة لأربعة أسابيع يكسر هذا الثبات عادةً أسرع من الإصرار على الحركة نفسها.',+ 'Example data, stored only in this browser — change anything you like.': 'بيانات نموذجية، محفوظة في هذا المتصفح فقط — غيّر ما تشاء.',+ 'Full body A': 'الجسم كامل A',+ 'Full body B': 'الجسم كامل B',+ 'Horizontal pressing, the other half of the session.': 'دفع أفقي، النصف الآخر من الجلسة.',+ 'Live demo — everything stays in this browser.': 'عرض تجريبي مباشر — يبقى كل شيء في هذا المتصفح.',+ 'No training history yet — starting conservatively.': 'لا يوجد سجل تدريب بعد — نبدأ بحذر.',+ 'Passkey sign-in, sync across your devices, your own data.': 'تسجيل دخول بمفتاح المرور، ومزامنة بين أجهزتك، وبياناتك ملكك.',+ 'Puts the example plan, workouts and weigh-ins back the way they started.': 'يعيد الخطة والتمارين وقياسات الوزن النموذجية إلى حالتها الأولى.',+ 'Reset': 'إعادة تعيين',+ 'Reset demo data': 'إعادة تعيين بيانات العرض التجريبي',+ 'Reset demo data?': 'إعادة تعيين بيانات العرض التجريبي؟',+ 'Revised as you asked. Everything you did not question is exactly as it was.': 'عُدِّلت كما طلبت. كل ما لم تعترض عليه بقي كما كان تمامًا.',+ 'Same pattern, higher reps than day A.': 'النمط نفسه، بتكرارات أكثر من اليوم A.',+ 'Self-host it in a minute →': 'استضفه بنفسك في دقيقة ←',+ 'Self-host openGym': 'استضف openGym بنفسك',+ 'Sessions have been running about fifteen minutes over. This is the accessory with the least to lose from one set fewer.': 'تتجاوز الجلسات وقتها بنحو خمس عشرة دقيقة. هذا هو التمرين المساعد الأقل خسارة من نقص مجموعة واحدة.',+ 'Start the demo': 'ابدأ العرض التجريبي',+ 'The main lower-body driver — where most of the strength comes from.': 'المحرك الرئيسي للجزء السفلي — ومنه تأتي معظم القوة.',+ 'The same patterns, different variations — enough overlap to progress, enough difference to stay fresh.': 'الأنماط نفسها بتنويعات مختلفة — تداخل يكفي للتقدم، واختلاف يكفي لتبقى متجددة.',+ 'The two big lower-body and pressing patterns first, while you are fresh.': 'النمطان الكبيران للجزء السفلي والدفع أولًا، وأنت في كامل نشاطك.',+ 'This demo runs entirely in your browser on example data — nothing is sent anywhere. Passkey sign-in and sync across your devices come with the openGym server, which you get by self-hosting it.': 'يعمل هذا العرض التجريبي بالكامل في متصفحك على بيانات نموذجية — لا يُرسَل شيء إلى أي مكان. يأتي تسجيل الدخول بمفتاح المرور والمزامنة بين أجهزتك مع خادم openGym، الذي تحصل عليه باستضافته بنفسك.',+ 'Three things worth changing, and one worth knowing about. Everything else is working — the squat and the pulls are both progressing on schedule.': 'ثلاثة أمور تستحق التغيير، وأمر واحد يستحق المعرفة. كل ما عدا ذلك يعمل — السكوات وتمارين السحب يتقدمان وفق الجدول.',+ 'Vertical pressing.': 'دفع عمودي.',+ 'You have moved this session to Saturday three weeks running. Better the plan says so than that you keep overriding it.': 'نقلت هذه الجلسة إلى السبت ثلاثة أسابيع متتالية. من الأفضل أن تنص الخطة على ذلك بدل أن تغيّرها كل مرة.',+ 'You’re in the demo': 'أنت في العرض التجريبي',}diff --git a/frontend/src/views/Plan.swipe-delete.test.jsx b/frontend/src/views/Plan.swipe-delete.test.jsxindex 40d3a77a9..b12c65a01 100644--- a/frontend/src/views/Plan.swipe-delete.test.jsx+++ b/frontend/src/views/Plan.swipe-delete.test.jsx@@ -55,6 +55,23 @@ describe('routine rows after swipe-to-delete', () => {expect(r.style.transform).toBe('translateX(0px)')})+ // In Arabic the button sits at the row's inline end, the left, so the row slides the other way.+ it('slide towards the right in a right-to-left language, where the button is on the left', () => {+ document.documentElement.dir = 'rtl'+ try {+ const r = row('Push A')+ act(() => { del('Push A').focus() })+ expect(r.style.transform).toBe('translateX(76px)')+ const start = new MouseEvent('mousedown', { bubbles: true, button: 0, clientX: 100, clientY: 10 })+ act(() => { r.focus() })+ expect(r.style.transform).toBe('translateX(0px)')+ act(() => { r.dispatchEvent(start) })+ act(() => { r.dispatchEvent(new MouseEvent('mousemove', { bubbles: true, buttons: 1, clientX: 180, clientY: 12 })) })+ act(() => { r.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, clientX: 180, clientY: 12 })) })+ expect(r.style.transform).toBe('translateX(76px)')+ } finally { document.documentElement.dir = '' }+ })+it('delete through the shared helper: the routine, its days and its reschedules', () => {act(() => { del('Pull A').dispatchEvent(new MouseEvent('click', { bubbles: true })) })const S = useStore.getState().Sdiff --git a/scripts/build-instructions.mjs b/scripts/build-instructions.mjsindex 831e579ca..f8fa84ed4 100644--- a/scripts/build-instructions.mjs+++ b/scripts/build-instructions.mjs@@ -13,7 +13,10 @@ import { dirname, join } from 'node:path'import { fileURLToPath } from 'node:url'const UPSTREAM = 'https://raw.githubusercontent.com/hasaneyldrm/exercises-dataset/main/data/exercises.json'-const LANGS = ['es', 'fr', 'it', 'tr', 'ru', 'zh', 'hi', 'pl', 'ko', 'ar']+// Arabic is not listed yet: its steps live in hasaneyldrm/exercises-dataset#82, which upstream+// has not merged, so frontend/src/instr/ar.js was built from that branch. Add 'ar' here once the+// steps are on upstream main.+const LANGS = ['es', 'fr', 'it', 'tr', 'ru', 'zh', 'hi', 'pl', 'ko']const root = join(dirname(fileURLToPath(import.meta.url)), '..')const outDir = join(root, 'frontend', 'src', 'instr')@@ -37,6 +40,12 @@ for (const lang of LANGS) {if (steps && steps.length) pack[ex.id] = steps}const file = join(outDir, lang + '.js')+ // A language the dataset carries no steps for leaves its pack alone: writing it anyway would+ // swap a working pack for an empty one, and every exercise would quietly fall back to English.+ if (!Object.keys(pack).length) {+ console.log(`${file}: no ${lang} steps in the dataset — pack left as it is`)+ continue+ }writeFileSync(file, '// generated by scripts/build-instructions.mjs — do not edit\nexport default ' + JSON.stringify(pack) + '\n')console.log(`${file}: ${Object.keys(pack).length} exercises`)}