feat(i18n): localize pt-BR exercise names
This commit is contained in:
1 parent
dc3fafc6ef
commit
448c66752f
21 files changed
+1615
-53
No files matched your search
+12
-12
@@ -5,7 +5,7 @@ import { EXDB, EXIDX, BODYPARTS, isCardio, isBodyweightEq, allExercises, equipme
|
||||
import { fmtDate, fmtNum, fmtVol, fmtDur, durPart, todayISO, uid, exCount, DAYN, MONTHS_LONG, ACCENTS } from './lib/format.js'
|
||||
import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, isBw, isPerSide, sideReps, workSetsDone } from './lib/history.js'
|
||||
import { beep, vibrate } from './lib/sound.js'
|
||||
import { t, instrFor, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { t, instrFor, exerciseNameFor, exerciseNameSearchText, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { nav } from './lib/nav.js'
|
||||
import { starterRoutines } from './lib/starter.js'
|
||||
import Media, { Thumb } from './components/Media.jsx'
|
||||
@@ -287,7 +287,7 @@ function ExerciseDetail({ ex, close }) {
|
||||
const last = lastEntryFor(st, ex.id)
|
||||
const best = bestWeightFor(st, ex.id)
|
||||
return <>
|
||||
<h3 className="capitalize">{ex.n}</h3>
|
||||
<h3 className="capitalize">{exerciseNameFor(ex)}</h3>
|
||||
<Media ex={ex} />
|
||||
<div className="row" style={{ gap: 6, flexWrap: 'wrap', margin: '10px 0' }}>
|
||||
<span className="tag acc">{t(ex.bp)}</span>
|
||||
@@ -321,12 +321,12 @@ function AddToRoutine({ ex, close }) {
|
||||
if (r) r.ex.push({ id: ex.id, ...cfg })
|
||||
})
|
||||
const r = isNew ? S().routines[S().routines.length - 1] : st.routines.find(x => x.id === rid)
|
||||
toast(t('“{0}” added to {1}', ex.n, r ? r.name : t('routine')))
|
||||
toast(t('“{0}” added to {1}', exerciseNameFor(ex), r ? r.name : t('routine')))
|
||||
if (isNew && r) nav('/plan/r/' + r.id)
|
||||
}, null, isNew ? null : st.routines.find(x => x.id === rid))
|
||||
}
|
||||
return <>
|
||||
<h3 className="capitalize">{t('Add “{0}”', ex.n)}</h3>
|
||||
<h3 className="capitalize">{t('Add “{0}”', exerciseNameFor(ex))}</h3>
|
||||
<div className="muted small" style={{ marginBottom: 12 }}>{t('Pick a routine — sets, reps & weight come next.')}</div>
|
||||
<div className="list">
|
||||
{st.routines.map(r => <div key={r.id} className="item" onClick={() => pick(r.id)}>
|
||||
@@ -426,8 +426,8 @@ function ExercisePicker({ onPick, close }) {
|
||||
const all = allExercises(st)
|
||||
let base = all.filter(e =>
|
||||
(bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) &&
|
||||
(!ql || e.n.toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
|
||||
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
|
||||
(!ql || exerciseNameSearchText(e).toLowerCase().includes(ql) || e.tg.includes(ql) || e.eq.includes(ql) || (e.desc || '').toLowerCase().includes(ql)))
|
||||
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || exerciseNameFor(a).localeCompare(exerciseNameFor(b)))
|
||||
const eqOpts = equipmentOf(base)
|
||||
// Drop the equipment filter if the search narrowed it away, so you never hit a dead end.
|
||||
const eqOn = eqOpts.includes(eq) ? eq : ''
|
||||
@@ -452,7 +452,7 @@ function ExercisePicker({ onPick, close }) {
|
||||
<div className="grow"><div className="tt">{t('Create your own exercise')}</div><div className="ss">{t('name + body part, no animation')}</div></div><Icon name="plus" className="chev" />
|
||||
</div>}
|
||||
{f.slice(0, shown).map(e => <div key={e.id} className="item" onClick={() => onPick(e)}>
|
||||
<Thumb ex={e} /><div className="grow"><div className="tt capitalize">{e.n}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
|
||||
<Thumb ex={e} /><div className="grow"><div className="tt capitalize">{exerciseNameFor(e)}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
|
||||
{usage[e.id] && <span className="tag acc"><Icon name="starFill" /></span>}<Icon name="plus" className="chev" />
|
||||
</div>)}
|
||||
{f.length === 0 && bp === '★' && <div className="empty">{t('Nothing chosen yet — add exercises and they’ll show up here.')}</div>}
|
||||
@@ -531,7 +531,7 @@ function ExConfig({ ex, existing, onSave, onDelete, close, routine, initial }) {
|
||||
}
|
||||
}
|
||||
return <>
|
||||
<h3 className="capitalize">{ex.n}</h3>
|
||||
<h3 className="capitalize">{exerciseNameFor(ex)}</h3>
|
||||
<Media ex={ex} />
|
||||
<div className="row" style={{ gap: 6, flexWrap: 'wrap', margin: '10px 0 14px' }}>
|
||||
{cardio && <span className="tag acc"><Icon name="figureRun" />{t('Cardio')}</span>}
|
||||
@@ -762,7 +762,7 @@ function WorkoutDetail({ w, close }) {
|
||||
const ex = EXIDX[e.id]
|
||||
return <div key={i} className="row" style={{ marginBottom: 12, alignItems: 'flex-start' }}>
|
||||
{ex && <Thumb ex={ex} />}
|
||||
<div className="grow"><div className="tt capitalize" style={{ fontWeight: 600 }}>{ex ? ex.n : (e.n || e.id)} {w.prs && w.prs.includes(e.id) && <span className="pr"><Icon name="trophy" />PR</span>}</div>
|
||||
<div className="grow"><div className="tt capitalize" style={{ fontWeight: 600 }}>{ex ? exerciseNameFor(ex) : (e.n || e.id)} {w.prs && w.prs.includes(e.id) && <span className="pr"><Icon name="trophy" />PR</span>}</div>
|
||||
<div className="ss">{e.sets.filter(s => s.done).map(s => setLabel(e.id, s, e.target)).join(' · ') || t('no sets')}</div></div>
|
||||
</div>
|
||||
})}
|
||||
@@ -883,7 +883,7 @@ function TopWeight({ entryIdx, close }) {
|
||||
} else toast(t('Tracked — next time starts at {0}', fmtNum(S().exWeights[entry.id].w) + ' ' + st.unit))
|
||||
}
|
||||
return <>
|
||||
<h3 className="capitalize row" style={{ gap: 8 }}><Icon name="checkCircle" style={{ color: 'var(--acc)' }} />{t('{0} done', ex.n)}</h3>
|
||||
<h3 className="capitalize row" style={{ gap: 8 }}><Icon name="checkCircle" style={{ color: 'var(--acc)' }} />{t('{0} done', exerciseNameFor(ex))}</h3>
|
||||
<div className="muted small">{t('Confirm the weight you worked with — your highest becomes the default next time.')}{!unitDone && unit.length > 1 ? ' ' + t('Then finish the superset partner.') : ''}</div>
|
||||
<WeightInput value={v} setValue={setV} unit={st.unit} />
|
||||
<div style={{ height: 10 }} />
|
||||
@@ -921,8 +921,8 @@ function FinishSummary({ w, prs, e1prs = [], close }) {
|
||||
<div className="tile"><div className="l">{t('PRs')}</div><div className="v" style={{ fontSize: 20 }}>{prs.length || '—'}</div></div>
|
||||
</div>
|
||||
{(prs.length > 0 || e1prs.length > 0) && <div style={{ textAlign: 'left', marginBottom: 12 }}>
|
||||
{prs.map(id => <div key={id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} {(EXIDX[id] || {}).n || id}</div>)}
|
||||
{e1prs.map(p => <div key={p.id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="chartLine" style={{ fontSize: 13 }} />{t('Best estimated 1RM:')} {(EXIDX[p.id] || {}).n || p.id} · {fmtNum(p.est)} {st.unit}</div>)}
|
||||
{prs.map(id => <div key={id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="trophy" style={{ fontSize: 13 }} />{t('New PR:')} {EXIDX[id] ? exerciseNameFor(EXIDX[id]) : id}</div>)}
|
||||
{e1prs.map(p => <div key={p.id} className="small accent capitalize row" style={{ gap: 5 }}><Icon name="chartLine" style={{ fontSize: 13 }} />{t('Best estimated 1RM:')} {EXIDX[p.id] ? exerciseNameFor(EXIDX[p.id]) : p.id} · {fmtNum(p.est)} {st.unit}</div>)}
|
||||
</div>}
|
||||
<h4 className="sec" style={{ textAlign: 'left' }}>{t('What you just trained')}</h4>
|
||||
<BodyMap load={loadOfWorkouts([w])} body={st.body} />
|
||||
|
||||
Reference in new issue
Block a user