Merge merge request !16 (pt-BR exercise names and instructions)

Resolves against !13 and !1: the picker and library keep the multi-token
search and the equipment-profile filter, and matchExercise now builds its
haystack from exerciseNameSearchText, so a pt-BR profile finds an exercise
by the name it actually sees as well as by the English one. The 'chosen'
sort takes !16's locale-aware localeCompare. Adds regression tests for
localized search and for cache invalidation on a language switch.
This commit is contained in:
Duarte Santos committed 2026-08-25 14:13:03 +02:00
commit 76973edad1
33 files changed
+12376 -52

No files matched your search

+4 -1
View File
@@ -117,7 +117,10 @@ animations are © Gym visual, not CC, which matters if you redistribute them.
### Features
- 🇧🇷 **Brazilian Portuguese UI** — Portuguese now has separate Portugal and
Brazil options, with Brazilian terminology and date formatting.
Brazil options, with Brazilian terminology, date formatting and localized
instructions for all 1,324 exercises. Built-in exercise titles show the
Brazilian Portuguese name followed by the canonical English name, so both
vocabularies remain recognizable and searchable.
### Fixes
+8
View File
@@ -115,3 +115,11 @@ runtime.
If you want to reuse the media — in openGym or anywhere else, commercially or not — **clear it with
the rights holder first**, and keep any attribution that accompanies it intact.
Brazilian Portuguese exercise instructions under
`scripts/instruction-sources/pt-BR.json` and exercise names under
`scripts/exercise-name-sources/pt-BR.json` are original translations of that
English source produced with OpenAI Codex and Anthropic Claude Code
language-model assistance. They are not copied from a separate Portuguese
dataset. Their review status and translation policy are documented alongside
the source files.
+2 -2
View File
@@ -84,7 +84,7 @@ as a home-screen app, passkey sign-in, offline support, sync across your phone a
- 🔑 **Passkeys, not passwords** — Face ID / Touch ID / fingerprint login; each profile keeps its own data, synced across devices. Sign-ins last 90 days by default (configurable), and “sign out everywhere” in Settings ends every session on every device at once
- 🛠️ **Admin dashboard** (optional) — for whoever runs the instance: who's training right now, per-user history, disable accounts, invite-only signup, and an **activity log** of sign-ins, failed attempts and admin actions. Off by default, so a fresh instance stays open with no admin
- 🎨 **Designed, not assembled** — light/dark themes and 8 accent colors saved to your profile, over a hand-drawn icon set instead of emoji, so it looks the same on every phone
- 🌍 **13 languages** — full UI translation (EN, DE, ES, FR, IT, PT (Portugal), PT (Brazil), PL, TR, RU, ZH, KO, HI); exercise instructions localized in 10 of them, loaded on demand so the app stays fast
- 🌍 **13 languages** — full UI translation (EN, DE, ES, FR, IT, PT (Portugal), PT (Brazil), PL, TR, RU, ZH, KO, HI); exercise instructions localized in 11 of them and built-in exercise names shown bilingually in PT-BR, all loaded on demand so the app stays fast
- 📥 **Bring your history with you** — import from **FitNotes** (Android and iOS), **Strong** and **Hevy**, or body weight straight out of an **Apple Health** export. Exercise names are matched against the library and anything unrecognised becomes one of your own exercises, so nothing in the file is dropped
- 📦 **Yours to keep** — one-tap JSON export/import, guest mode, **no telemetry**
- 🤖 **Ask an AI about your training** (optional) — an [MCP server](mcp/README.md) lets a client like Claude Desktop or Cursor read your history in your own words: *"what did I bench last week?"*. Read-only, spawned locally by the client, nothing leaves your box. Not in the Docker build — if you don't use an AI assistant, it isn't there
@@ -201,7 +201,7 @@ Rough, community-driven — ideas and PRs welcome:
- [x] Effort per set — RIR or RPE, whichever scale you think in
- [ ] Body measurements (waist, arms…) alongside weight
- [ ] Per-exercise notes & plate calculator
- [ ] Exercise instructions in German & Portuguese (UI is translated; upstream dataset doesn't ship these yet)
- [ ] Exercise instructions in German & Portuguese (Portugal); the separately curated Brazilian Portuguese pack is complete
## Tech
+2 -2
View File
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { imgSrc, gifSrc } from '../lib/exercises.js'
import { useStore } from '../store/useStore.js'
import { t } from '../lib/i18n.js'
import { t, exerciseNameFor } from '../lib/i18n.js'
import Icon from './Icon.jsx'
// Big autoplaying animation; tap toggles to the still frame. `compact` shrinks it (superset cards).
@@ -18,7 +18,7 @@ export default function Media({ ex, id, compact, minimizable }) {
const toggleSize = e => { e.stopPropagation(); update(s => { s.gifSize = mini ? 'full' : 'mini' }) }
return (
<div className={'exmedia' + (compact ? ' compact' : '') + (mini ? ' mini' : '')} id={id} onClick={() => setPlaying(p => !p)}>
<img decoding="async" src={playing ? gifSrc(ex) : imgSrc(ex)} alt={ex.n} />
<img decoding="async" src={playing ? gifSrc(ex) : imgSrc(ex)} alt={exerciseNameFor(ex)} />
{minimizable && (
<button className="giftoggle" onClick={toggleSize}>
<Icon name={mini ? 'expand' : 'minimize'} />{mini ? t('Expand') : t('Minimize')}
+2
View File
@@ -0,0 +1,2 @@
// generated by scripts/build-pt-br-exercise-names.mjs — edit scripts/exercise-name-sources/pt-BR.json
export default {"1000":"elevação de panturrilha invertida unilateral com faixa elástica","1001":"afundo estático unilateral com faixa elástica","1002":"elevação de pernas retas deitado com faixa elástica","1003":"agachamento com remada e faixa elástica","1004":"agachamento com faixa elástica","1005":"abdominal em pé com faixa elástica","1007":"abdominal rotacional em pé com faixa elástica","1008":"subida no step com faixa elástica","1009":"levantamento terra pernas semiestendidas com faixa elástica","1010":"levantamento terra pernas estendidas com faixa elástica","1011":"torção sentado com faixa elástica","1012":"desenvolvimento acima da cabeça com rotação e faixa elástica","1013":"puxada pegada supinada com faixa elástica","1014":"abdominal em v com faixa elástica","1015":"pallof press vertical com faixa elástica","1016":"rosca de punho com faixa elástica","1017":"elevação em y com faixa elástica","1018":"encolhimento de ombros com faixa elástica","1022":"remada para deltoide posterior em pé com faixa elástica","1023":"levantamento terra pernas semiestendidas com costas retas e faixa elástica","1160":"burpee","1167":"alongamento dinâmico de peitoral (masculino)","1201":"Burpee com halteres","1253":"elevação de panturrilha burro na máquina","1254":"supino com faixa elástica","1255":"pullover declinado com barra","1256":"supino declinado pegada supinada com barra","1257":"supino inclinado pegada supinada com barra","1258":"supino pegada aberta supinada com barra","1259":"alongamento de peitoral atrás da cabeça","1260":"supino declinado unilateral no cabo","1261":"supino declinado no cabo","1262":"crucifixo declinado unilateral no cabo","1263":"crucifixo unilateral na bola de exercício no cabo","1264":"crucifixo inclinado unilateral na bola de exercício no cabo","1265":"supino inclinado unilateral no cabo","1266":"supino inclinado unilateral na bola de exercício no cabo","1267":"supino unilateral na bola de exercício no cabo","1268":"supino na bola de exercício no cabo","1269":"crossover em pé ereto no cabo","1270":"crossover para peitoral superior no cabo","1271":"alongamento de peito e parte frontal do ombro","1272":"alongamento de peito com bola de exercício","1273":"flexão de braços com palma","1274":"flexão de braços profunda","1275":"flexão de braços com queda","1276":"Crucifixo declinado unilateral com halter","1277":"Crucifixo com halteres na bola de estabilidade","1278":"Crucifixo inclinado com halteres na bola de estabilidade","1279":"Crucifixo inclinado unilateral com halter","1280":"Crucifixo inclinado unilateral com halter na bola de estabilidade","1281":"Supino inclinado unilateral com halter","1282":"Supino inclinado unilateral com halter na bola de estabilidade","1283":"Supino inclinado com halteres na bola de estabilidade","1284":"Pullover deitado na bola de estabilidade com halter","1285":"Crucifixo unilateral no banco com halter","1286":"Crucifixo unilateral na bola de estabilidade com halter","1287":"Supino declinado unilateral com halter","1288":"Crucifixo unilateral na bola de estabilidade com halter","1289":"Supino inclinado unilateral com halter","1290":"Supino unilateral na bola de estabilidade com halter","1291":"Pullover unilateral na bola de estabilidade com halter","1292":"Crucifixo com uma perna na bola de estabilidade (halteres)","1293":"Supino na bola de estabilidade com halteres","1294":"Pullover com extensão de quadril na bola de estabilidade (halteres)","1295":"Pullover na bola de estabilidade com halteres","1296":"flexão de braços em pique na bola de estabilidade","1297":"contração isométrica de peitoral","1298":"supino unilateral com kettlebell no chão","1299":"supino inclinado na máquina","1300":"supino declinado na máquina","1301":"supino interno na máquina","1302":"passe de peito com bola medicinal","1303":"empurrão de peito com bola medicinal a partir de três apoios","1304":"empurrão de peito com bola medicinal (resposta múltipla)","1305":"empurrão de peito com bola medicinal (resposta única)","1306":"flexão de braços pliométrica","1307":"flexão de braços na bosu","1308":"supino pegada aberta na máquina Smith","1309":"supino declinado pegada aberta na máquina Smith","1310":"flexão de braços com queda e peso","1311":"flexão de braços com mãos afastadas","1312":"empurrão de peito com bola medicinal com saída em corrida","1313":"remada unilateral na máquina","1314":"extensão de tronco na bola de estabilidade","1316":"pullover com braços flexionados com barra","1317":"remada no banco inclinado pegada supinada com barra","1318":"remada no banco inclinado no cabo","1319":"remada com rotação da palma no cabo","1320":"remada sentada crossover com corda no cabo","1321":"remada sentada elevada com corda no cabo","1322":"remada no banco inclinado com extensão de corda no cabo","1323":"remada sentada com corda no cabo","1324":"remada superior no cabo","1325":"puxada atrás da nuca pegada abLine truncated
+2
View File
@@ -0,0 +1,2 @@
// generated by scripts/build-pt-br-instructions.mjs — edit scripts/instruction-sources/pt-BR.json
export default {"1000":["Fique em pé com os pés afastados na largura do quadril e posicione a faixa elástica ao redor da parte anterior do pé.","Segure-se em um objeto estável para se equilibrar.","Eleve lentamente o calcanhar do chão, transferindo o peso corporal para a parte anterior do pé.","Faça uma breve pausa no alto e depois abaixe lentamente o calcanhar até a posição inicial.","Repita pelo número desejado de repetições e depois troque para a outra perna."],"1001":["Fique em pé com os pés afastados na largura do quadril e coloque uma faixa elástica ao redor dos tornozelos.","Dê um passo grande à frente com o pé direito e um passo menor para trás com o pé esquerdo.","Flexione os joelhos e abaixe o corpo até que a coxa direita fique paralela ao chão, mantendo o joelho esquerdo ligeiramente acima do chão.","Empurre o chão com o calcanhar direito para retornar à posição inicial.","Repita do outro lado."],"1002":["Deite-se de costas com as pernas retas e os pés juntos.","Coloque a faixa elástica ao redor do arco dos pés e segure as extremidades da faixa com as mãos.","Contraindo o abdômen, eleve as duas pernas do chão até ficarem perpendiculares ao chão.","Faça uma pausa no topo do movimento e, em seguida, abaixe lentamente as pernas até a posição inicial.","Repita pelo número desejado de repetições."],"1003":["Prenda a faixa elástica a um ponto de ancoragem firme na altura da cintura.","Fique em pé de frente para o ponto de ancoragem, com os pés afastados na largura dos ombros.","Segure as alças da faixa elástica com as palmas voltadas uma para a outra e os braços estendidos à frente.","Flexione os joelhos e desça até a posição de agachamento, mantendo as costas retas e o peito elevado.","A partir da posição de agachamento, puxe as alças da faixa elástica em direção ao corpo, aproximando as escápulas.","Faça uma breve pausa no final do movimento; depois, libere lentamente a tensão e retorne à posição inicial.","Repita pelo número desejado de repetições."],"1004":["Fique em pé com os pés afastados na largura dos ombros e a faixa elástica posicionada logo acima dos joelhos.","Mantendo o peito elevado e o abdômen contraído, leve o quadril para trás e flexione os joelhos para descer até a posição de agachamento.","Certifique-se de que os joelhos acompanhem a direção dos dedos dos pés e que o peso esteja sobre os calcanhares.","Faça uma breve pausa embaixo; depois, empurre o chão com os calcanhares para retornar à posição inicial.","Repita pelo número desejado de repetições."],"1005":["Fixe a faixa elástica em um ponto de ancoragem firme na altura da cintura.","Fique de pé de costas para o ponto de ancoragem, com os pés afastados na largura dos ombros.","Segure a faixa com as duas mãos e traga-a até o peito, mantendo os cotovelos dobrados e próximos ao corpo.","Contraia o abdômen e flexione o tronco lentamente para frente, levando o peito em direção aos joelhos.","Faça uma pausa no topo do movimento e, em seguida, retorne lentamente à posição inicial.","Repita pelo número desejado de repetições."],"1007":["Fique de pé com os pés afastados na largura dos ombros e passe a faixa elástica pela parte superior das costas, cruzando-a na frente do peito.","Segure as extremidades da faixa com as mãos, mantendo os cotovelos dobrados e próximos ao corpo.","Contraia o abdômen e gire o tronco para um dos lados, levando o cotovelo em direção ao joelho oposto.","Faça uma pausa e, em seguida, retorne à posição inicial.","Repita do outro lado.","Continue alternando os lados pelo número desejado de repetições."],"1008":["Coloque uma faixa elástica ao redor das coxas, logo acima dos joelhos.","Fique em pé de frente para um degrau ou plataforma, com os pés afastados na largura do quadril.","Suba na plataforma com o pé direito, empurrando-a com o calcanhar.","Estenda a perna esquerda para trás, mantendo-a reta.","Abaixe o pé esquerdo de volta ao chão.","Repita subindo na plataforma com o pé esquerdo.","Continue alternando as pernas pelo número desejado de repetições."],"1009":["Fique em pé com os pés afastados na largura dos ombros e coloque a faixa elástica ao redor dos tornozelos.","Segure a faixa elástica com as duas mãos à frente das coxas, com as palmas voltadas para o corpo.","Mantendo as costas retas e o abdômen contraído, incline o tronco à frente a partir do quadril e abaixe lentamente a parte superior do corpo em direção ao chão.","Ao descer, leve o quadril para trás e deixe os joelhos flexionarem levemente.","Abaixe a faixa elástica em direção ao chão, sentindo o alongamento nos músculos posteriores das coxas.","Faça uma breve pausa embaixo; depois, contraia os glúteos e os músculos posteriores das coxas para elevar a parte superior do corpo de volta à posição inicial.","Repita pelo número desejado de repetições."],"1010":["Fique em pé com os pés afastados na Line truncated
+2 -2
View File
@@ -1,5 +1,5 @@
import { EXDB } from './exercises-data.js'
import { t, getVersion } from './i18n-core.js'
import { t, getVersion, exerciseNameSearchText } from './i18n-core.js'
export { EXDB }
@@ -102,7 +102,7 @@ function corpusOf(e) {
if (hit && hit.v === v) return hit.s
const sm = Array.isArray(e?.sm) ? e.sm : []
const s = normalizeStr([
e?.n || '',
exerciseNameSearchText(e),
e?.tg || '', t(e?.tg || ''),
e?.eq || '', t(e?.eq || ''),
e?.bp || '', t(e?.bp || ''),
+21
View File
@@ -97,4 +97,25 @@ describe('matchExercise', () => {
expect(matchExercise(benchPress, 'peito barra bench')).toBe(true)
expect(matchExercise(lateralRaise, 'halteres ombros')).toBe(true)
})
// The pt-BR exercise-name pack (!16) renames the catalogue in the UI. Searching has to reach
// that name as well as the canonical English one, or the library goes dark for pt-BR profiles
// the moment they type what they see on screen.
it('matches the localized exercise name as well as the English one', () => {
_setLangState('pt-BR', {}, null, { '0025': 'supino reto com barra' })
expect(matchExercise(benchPress, 'supino')).toBe(true)
expect(matchExercise(benchPress, 'supino barra')).toBe(true)
expect(matchExercise(benchPress, 'bench press')).toBe(true) // English still reaches it
expect(matchExercise(lateralRaise, 'supino')).toBe(false) // untranslated entry unaffected
})
it('rebuilds the cached haystack when the language changes', () => {
_setLangState('pt-BR', {}, null, { '0025': 'supino reto com barra' })
expect(matchExercise(benchPress, 'supino')).toBe(true)
_setLangState('en', null, null, null)
expect(matchExercise(benchPress, 'supino')).toBe(false)
expect(matchExercise(benchPress, 'bench')).toBe(true)
})
})
+26 -4
View File
@@ -1,5 +1,6 @@
// Runtime-agnostic core of the i18n module: state, constants and readers (t, dateLocale,
// instrFor, getLang). Plain Node-loadable — the browser-only pieces (import.meta.glob lazy
// instrFor, exerciseNameFor, getLang). Plain Node-loadable — the browser-only pieces
// (import.meta.glob lazy
// loads, the React subscription hook) live in i18n.js and re-export from here.
export const LANGS = {
@@ -8,7 +9,8 @@ export const LANGS = {
tr: 'Türkçe', ru: 'Русский', zh: '中文',
ko: '한국어', hi: 'हिन्दी'
}
export const INSTR_LANGS = ['en', 'es', 'fr', 'it', 'tr', 'ru', 'zh', 'hi', 'pl', 'ko']
export const INSTR_LANGS = ['en', 'es', 'fr', 'it', 'tr', 'ru', 'zh', 'hi', 'pl', 'ko', 'pt-BR']
export const EXERCISE_NAME_LANGS = ['pt-BR']
export const DATE_LOCALES = {
en: 'en-GB', de: 'de-DE', es: 'es-ES', fr: 'fr-FR', it: 'it-IT', pt: 'pt-PT', 'pt-BR': 'pt-BR',
pl: 'pl-PL', tr: 'tr-TR', ru: 'ru-RU', zh: 'zh-CN', ko: 'ko-KR', hi: 'hi-IN'
@@ -17,6 +19,7 @@ export const DATE_LOCALES = {
let lang = 'en' // set only by _setLangState, called from i18n.js setLang
let dict = {} // current locale pack (empty = English fallback)
let instr = null // { exId: [steps] } for the current language, null = English
let exerciseNames = null // { exId: translated name }, null = original catalogue name
let version = 0 // bumped on every setLang; drives the React subscription selector
export const getLang = () => lang
@@ -33,13 +36,32 @@ 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.
// User-created exercises have no entry in the pack and keep their exact chosen name.
export const exerciseNameFor = ex => {
const translated = exerciseNames && ex && exerciseNames[ex.id]
if (!translated) return ex?.n || ''
// Some names (Burpee, Pilates, brand/model terms) are the established pt-BR term too.
// Repeating an identical loanword in parentheses adds noise rather than context.
return translated.toLocaleLowerCase('pt-BR') === ex.n.toLocaleLowerCase('en')
? translated
: `${translated} (${ex.n})`
}
// Search both the localized and canonical English title without changing persisted data.
export const exerciseNameSearchText = ex => {
const translated = exerciseNames && ex && exerciseNames[ex.id]
return translated ? `${translated} ${ex.n}` : (ex?.n || '')
}
// Called by i18n.js's setLang once the locale pack has been loaded — kept here rather than
// exported as setLang because loading packs requires import.meta.glob, which is Vite-only.
// Both `dict` and `instr` may be null to reset to English.
export function _setLangState(newLang, newDict, newInstr) {
// `dict`, `instr` and `exerciseNames` may be null to reset to their English fallbacks.
export function _setLangState(newLang, newDict, newInstr, newExerciseNames) {
lang = LANGS[newLang] ? newLang : 'en'
dict = lang === 'en' ? {} : (newDict || {})
instr = lang === 'en' || !INSTR_LANGS.includes(lang) ? null : (newInstr || null)
exerciseNames = lang === 'en' || !EXERCISE_NAME_LANGS.includes(lang) ? null : (newExerciseNames || null)
version++
return version
}
+17 -10
View File
@@ -5,16 +5,20 @@
import { useSyncExternalStore } from 'react'
import {
LANGS, INSTR_LANGS, DATE_LOCALES,
getLang, dateLocale, t, instrFor, getVersion, _setLangState
LANGS, INSTR_LANGS, EXERCISE_NAME_LANGS, DATE_LOCALES,
getLang, dateLocale, t, instrFor, exerciseNameFor, exerciseNameSearchText, getVersion, _setLangState
} from './i18n-core.js'
export { LANGS, INSTR_LANGS, DATE_LOCALES, getLang, dateLocale, t, instrFor }
export {
LANGS, INSTR_LANGS, EXERCISE_NAME_LANGS, DATE_LOCALES,
getLang, dateLocale, t, instrFor, exerciseNameFor, exerciseNameSearchText
}
// Vite code-splits each locale pack into its own chunk via import.meta.glob; instructions use
// the same mechanism in src/instr/. Both are lazy, so the production bundle ships English only.
// Vite code-splits locale, instruction and exercise-name packs via import.meta.glob. They are
// lazy, so the production bundle ships English only until another language is selected.
const localePacks = import.meta.glob('../locales/*.js')
const instrPacks = import.meta.glob('../instr/*.js')
const exerciseNamePacks = import.meta.glob('../exercise-names/*.js')
// React subscription bookkeeping — kept here, not in core, so core has zero React coupling.
const subs = new Set()
@@ -23,12 +27,15 @@ const notify = () => { subs.forEach(f => f()) }
export async function setLang(l) {
if (!LANGS[l]) l = 'en'
if (l === getLang() && getVersion() > 0) return
let dict = {}, instr = null
let dict = {}, instr = null, exerciseNames = null
try { dict = l === 'en' ? {} : (await localePacks['../locales/' + l + '.js']()).default } catch (e) { dict = {} }
try { instr = l === 'en' || !INSTR_LANGS.includes(l) ? null : (await instrPacks['../instr/' + l + '.js']()).default } catch (e) { instr = null }
try {
dict = l === 'en' ? {} : (await localePacks['../locales/' + l + '.js']()).default
instr = l === 'en' || !INSTR_LANGS.includes(l) ? null : (await instrPacks['../instr/' + l + '.js']()).default
} catch (e) { dict = {}; instr = null }
_setLangState(l, dict, instr)
exerciseNames = l === 'en' || !EXERCISE_NAME_LANGS.includes(l)
? null
: (await exerciseNamePacks['../exercise-names/' + l + '.js']()).default
} catch (e) { exerciseNames = null }
_setLangState(l, dict, instr, exerciseNames)
notify()
}
+2 -2
View File
@@ -11,7 +11,7 @@
import { EXIDX, isBodyweightEq } from './exercises.js'
import { modeOf, fmtSec, isBw, isPerSide, sideReps } from './history.js'
import { uid, todayISO, DAYN, fmtNum, exCount } from './format.js'
import { t } from './i18n-core.js'
import { t, exerciseNameFor } from './i18n-core.js'
const PLAN_FMT = 1
const WEEK_ORDER = [1, 2, 3, 4, 5, 6, 0] // Mon-first, matching the Plan screen
@@ -173,7 +173,7 @@ function routineHTML(r, unit) {
const rows = units(r.ex).map(u => {
const items = u.map(e => {
const ex = EXIDX[e.id]
const name = ex ? ex.n : t('Unknown exercise')
const name = ex ? exerciseNameFor(ex) : t('Unknown exercise')
const part = ex && ex.bp && ex.bp !== 'cardio' ? `<span class="part">${esc(ex.bp)}</span>` : ''
const note = e.note ? `<div class="ex-note">${esc(e.note)}</div>` : ''
return `<div class="ex"><div class="ex-row"><div class="ex-n">${esc(name)}${part}</div><div class="ex-s">${esc(scheme(e, unit))}</div></div>${note}</div>`
@@ -0,0 +1,61 @@
import { afterEach, describe, expect, test } from 'vitest'
import { readFileSync } from 'node:fs'
import ptBR from '../exercise-names/pt-BR.js'
import { EXDB } from './exercises-data.js'
import {
EXERCISE_NAME_LANGS, _setLangState, exerciseNameFor, exerciseNameSearchText
} from './i18n-core.js'
describe('Brazilian Portuguese exercise names', () => {
const source = JSON.parse(readFileSync(new URL('../../../scripts/exercise-name-sources/pt-BR.json', import.meta.url), 'utf8'))
afterEach(() => _setLangState('en', {}, null, null))
test('matches the curated source and covers the complete built-in catalogue', () => {
expect(Object.keys(ptBR)).toHaveLength(EXDB.length)
expect(ptBR).toEqual(source)
expect(EXERCISE_NAME_LANGS).toContain('pt-BR')
})
test('contains a non-empty translation for every known exercise', () => {
for (const exercise of EXDB) {
expect(ptBR[exercise.id]?.trim(), exercise.id).toBeTruthy()
expect(ptBR[exercise.id], exercise.id).not.toMatch(/(?:^|[^\p{L}])(?:abdómen|anca|gémeos|ecrã|ginásio|banda|piso|omoplata|pegada inversa|pegada invertida)(?=$|[^\p{L}])/iu)
}
})
test('preserves identity-changing qualifiers and equipment', () => {
const rules = [
[/assisted/iu, /assistid/iu],
[/weighted/iu, /(?:peso|carga|lastro|ponderad)/iu],
[/(?:^|[^\p{L}])male(?=$|[^\p{L}])/iu, /masculin/iu],
[/(?:^|[^\p{L}])female(?=$|[^\p{L}])/iu, /feminin/iu],
[/barbell/iu, /barra/iu],
[/dumbbell/iu, /halter/iu],
[/kettlebell/iu, /kettlebell/iu],
[/smith/iu, /smith/iu],
[/stability ball/iu, /bola de estabilidade/iu],
[/medicine ball/iu, /bola medicinal/iu],
]
for (const exercise of EXDB) {
for (const [english, portuguese] of rules) {
if (english.test(exercise.n)) expect(ptBR[exercise.id], `${exercise.id}: ${english}`).toMatch(portuguese)
}
}
})
test('shows Portuguese first and preserves the canonical English title', () => {
const exercise = EXDB[0]
_setLangState('pt-BR', {}, null, ptBR)
expect(exerciseNameFor(exercise)).toBe(`${ptBR[exercise.id]} (${exercise.n})`)
expect(exerciseNameSearchText(exercise)).toContain(ptBR[exercise.id])
expect(exerciseNameSearchText(exercise)).toContain(exercise.n)
})
test('never translates custom exercises or changes other languages', () => {
const custom = { id: 'custom-1', n: 'Meu exercício' }
_setLangState('pt-BR', {}, null, ptBR)
expect(exerciseNameFor(custom)).toBe('Meu exercício')
_setLangState('en', {}, null, null)
expect(exerciseNameFor(EXDB[0])).toBe(EXDB[0].n)
})
})
@@ -0,0 +1,55 @@
import { describe, expect, test } from 'vitest'
import { readFileSync } from 'node:fs'
import ptBR from '../instr/pt-BR.js'
import { EXDB } from './exercises-data.js'
import { INSTR_LANGS } from './i18n-core.js'
describe('Brazilian Portuguese exercise instructions', () => {
const exercises = new Map(EXDB.map(exercise => [exercise.id, exercise]))
const source = JSON.parse(readFileSync(new URL('../../../scripts/instruction-sources/pt-BR.json', import.meta.url), 'utf8'))
test('matches the curated source and covers the complete exercise corpus', () => {
expect(Object.keys(ptBR)).toHaveLength(EXDB.length)
expect(ptBR).toEqual(source)
})
test('only enables pt-BR instructions when the pack is complete', () => {
expect(INSTR_LANGS.includes('pt-BR')).toBe(Object.keys(ptBR).length === EXDB.length)
})
test('completes Stage 1 waist and core coverage', () => {
const stage = EXDB.filter(exercise => exercise.bp === 'waist')
expect(stage).toHaveLength(169)
stage.forEach(exercise => expect(ptBR, exercise.id).toHaveProperty(exercise.id))
})
test('contains only known exercises with complete, non-empty step lists', () => {
for (const [id, steps] of Object.entries(ptBR)) {
const exercise = exercises.get(id)
expect(exercise, `unknown exercise ${id}`).toBeDefined()
expect(steps, id).toHaveLength(exercise.st.length)
steps.forEach((step, index) => {
expect(step.trim(), `${id} step ${index + 1}`).not.toBe('')
expect(step, `${id} step ${index + 1}`).not.toBe(exercise.st[index])
expect(step, `${id} step ${index + 1}`).not.toMatch(/(?:^|[^\p{L}])(?:the|your|with|from|towards?|repeat|desired|starting|slowly|hold|while|then|back|straight|ground|feet|hands|body|legs|arms|knees|shoulders)(?=$|[^\p{L}])/iu)
expect(step, `${id} step ${index + 1}`).not.toMatch(/(?:^|[^\p{L}])(?:ginásio|anca|abdómen|gémeos|ecrã|core|banda|piso|omoplata|peso de mão|barra de elevações|pegada por cima|pegada invertida|pegada inversa|bola suíça)(?=$|[^\p{L}])/iu)
expect(step, `${id} step ${index + 1}`).not.toMatch(/flexion\p{L}*\s+(?:a\s+|o\s+|os\s+|um\s+|uma\s+)?(?:barra|pesos?|halter(?:es)?|mão)(?=$|[^\p{L}])/iu)
})
}
})
test('does not replace kettlebells with dumbbells', () => {
for (const exercise of EXDB) {
exercise.st.forEach((step, index) => {
if (/kettlebells?/iu.test(step)) {
expect(ptBR[exercise.id][index], `${exercise.id} step ${index + 1}`).toMatch(/kettlebells?/iu)
}
})
}
})
test('uses wrist extension for reverse wrist curls', () => {
const reverseWristCurlIds = ['0079', '0082', '0104', '0210', '0224', '0358', '0367', '0368', '0385', '0771', '0994', '1441']
reverseWristCurlIds.forEach(id => expect(ptBR[id].join(' '), id).toMatch(/estend\p{L}*(?: lentamente)? (?:o |os )?punhos?/iu))
})
})
+5 -4
View File
@@ -11,6 +11,7 @@ import { STRENGTH_FULL_MS, STRENGTH_HALF_LIFE_MS, STRENGTH_FLOOR, halfLifeDecay
import { musclesOf } from './muscles.js'
import { EXIDX } from './exercises.js'
import { isWarmupRow } from './workout-model.js'
import { exerciseNameFor } from './i18n-core.js'
const round1 = value => Math.round(value * 10) / 10
@@ -61,11 +62,11 @@ export function primaryMuscleOf(entry) {
return best
}
function exerciseName(entry) {
function resolvedExerciseName(entry) {
// Imported history often has no name snapshot (entries are { id, sets, topW }) - the
// catalogue (or the registered custom) is the canonical name source.
const ex = entry && typeof entry === 'object' ? EXIDX[entry.id] : null
if (ex?.n) return ex.n
if (ex?.n) return exerciseNameFor(ex)
if (entry?.muscleSnapshot?.n) return entry.muscleSnapshot.n
return entry && typeof entry === 'object' && entry.n ? entry.n : null
}
@@ -97,7 +98,7 @@ export function strengthExerciseRows(S, now) {
const decay = lastAt == null ? STRENGTH_FLOOR : strengthFromAge(Number(now) - lastAt)
rows.push({
id,
name: exerciseName(entry) || id,
name: resolvedExerciseName(entry) || id,
est: best.est,
estDate: best.d,
primary: primaryMuscleOf(entry) ? primaryMuscleOf(entry).slug : null,
@@ -129,7 +130,7 @@ export function strengthExerciseRowsForMuscle(S, now, slug) {
const primary = primaryMuscleOf(entry)
seen.set(entry.id, {
id: entry.id,
name: exerciseName(entry) || entry.id,
name: resolvedExerciseName(entry) || entry.id,
weight,
primary: primary ? primary.slug : null,
est: best.est,
+11 -11
View File
@@ -6,7 +6,7 @@ import { activeProfile, exAvailable, ALL_EQUIPMENT, newProfile } from './lib/equ
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, 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'
@@ -288,7 +288,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>
@@ -322,12 +322,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)}>
@@ -429,7 +429,7 @@ function ExercisePicker({ onPick, close }) {
let base = all.filter(e =>
(bp === '★' ? usage[e.id] : (!bp || e.bp === bp)) &&
matchExercise(e, q))
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || (a.n < b.n ? -1 : 1))
if (bp === '★') base = [...base].sort((a, b) => (usage[b.id] - usage[a.id]) || exerciseNameFor(a).localeCompare(exerciseNameFor(b)))
const eqFiltered = (profile && !showAll) ? base.filter(e => exAvailable(st, e)) : base
const eqOpts = equipmentOf(eqFiltered)
// Drop the equipment filter if the search narrowed it away, so you never hit a dead end.
@@ -462,7 +462,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>}
@@ -590,7 +590,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>}
@@ -824,7 +824,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>
})}
@@ -945,7 +945,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 }} />
@@ -983,8 +983,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} />
+2 -2
View File
@@ -4,7 +4,7 @@ import { EXDB, BODYPARTS, allExercises, equipmentOf, matchExercise } from '../li
import { activeProfile, exAvailable } from '../lib/equipment.js'
import { bestWeightFor } from '../lib/history.js'
import { fmtNum } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { t, exerciseNameFor } from '../lib/i18n.js'
import { Thumb } from '../components/Media.jsx'
import { exerciseDetailSheet, addToRoutineSheet, customExSheet } from '../sheets.jsx'
import Icon from '../components/Icon.jsx'
@@ -53,7 +53,7 @@ export default function Library() {
const best = bestWeightFor(S, e.id)
return <div key={e.id} className="item" onClick={() => exerciseDetailSheet(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>
<div className="grow"><div className="tt capitalize">{exerciseNameFor(e)}</div><div className="ss capitalize">{t(e.tg || e.bp)} · {t(e.eq)}</div></div>
{best > 0 && <span className="tag acc">{fmtNum(best)}</span>}
<Button size="sm" variant="tinted" icon="plus" onClick={ev => { ev.stopPropagation(); addToRoutineSheet(e) }}>{t('Plan')}</Button>
</div>
+2 -2
View File
@@ -4,7 +4,7 @@ import { useStore } from '../store/useStore.js'
import { exOr } from '../lib/exercises.js'
import { activeProfile, exAvailable } from '../lib/equipment.js'
import { uid } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { t, exerciseNameFor } from '../lib/i18n.js'
import { supersetUnits, cleanupSg, exLine } from '../lib/history.js'
import { Thumb } from '../components/Media.jsx'
import { glyphPicker, exercisePicker, exConfigSheet, confirmSheet } from '../sheets.jsx'
@@ -78,7 +78,7 @@ export default function RoutineEdit() {
exConfigSheet(ex, e, cfg => edit(x => { x[i] = { id: x[i].id, sg: x[i].sg, ...cfg } }), () => edit(x => { x.splice(i, 1); cleanupSg(x) }), r)
}}>
<Thumb ex={ex} />
<div className="grow"><div className="tt capitalize">{ex.n}</div><div className="ss">{exLine(e, S.unit)}</div>
<div className="grow"><div className="tt capitalize">{exerciseNameFor(ex)}</div><div className="ss">{exLine(e, S.unit)}</div>
{e.note && <div className="small dim" style={{ marginTop: 2 }}>{e.note}</div>}</div>
{noEquip && <span className="tag" style={{ color: 'var(--orange)', borderColor: 'var(--orange)' }} title={t('Needs {0} — not in your active profile', t(ex.eq))}><Icon name="warning" /></span>}
<div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 'none', alignItems: 'center' }}>
+4 -3
View File
@@ -4,7 +4,7 @@ import { useStore } from '../store/useStore.js'
import { EXIDX } from '../lib/exercises.js'
import { lastBW, streakWeeks, setLabel, modeOf, effortOf, metricModeForEntry, metricRowsForEntry, bestWeightForEntry } from '../lib/history.js'
import { fmtNum, fmtDate, fmtVol, todayISO, weekKey } from '../lib/format.js'
import { t } from '../lib/i18n.js'
import { t, exerciseNameFor, getLang } from '../lib/i18n.js'
import { bwSheet, goalSheet, calendarSheet, workoutDetailSheet, WorkoutRow, bwDeltaColor } from '../sheets.jsx'
import LineChart from '../components/LineChart.jsx'
import Heatmap from '../components/Heatmap.jsx'
@@ -102,6 +102,7 @@ function MuscleBalance({ S }) {
const [hard, setHard] = useState(false)
const [sel, setSel] = useState(null)
const now = useNow()
const lang = getLang()
const workouts = S.workouts
// The user's own last registered bodyweight drives bodyweight-exercise tonnage.
const bodyweightKg = useMemo(() => {
@@ -113,7 +114,7 @@ function MuscleBalance({ S }) {
}, [S.bodyweight, S.unit])
const fatigue = useMemo(() => fatigueOf(workouts, now, { bodyweightKg, unit: S.unit }), [workouts, now, bodyweightKg, S.unit])
const strength = useMemo(() => strengthOf(workouts, now, { bodyweightKg, unit: S.unit }), [workouts, now, bodyweightKg, S.unit])
const muscleExercises = useMemo(() => (sel ? strengthExerciseRowsForMuscle(S, now, sel) : []), [S, now, sel])
const muscleExercises = useMemo(() => (sel ? strengthExerciseRowsForMuscle(S, now, sel) : []), [S, now, sel, lang])
const lastTrained = useMemo(() => latestMuscleTraining(workouts), [workouts])
const strengthHint = slug => {
if (lastTrained[slug] == null) return t('not trained')
@@ -290,7 +291,7 @@ export default function Stats() {
const workouts = S.workouts
const monthW = workouts.filter(w => String(w.d || '').slice(0, 7) === todayISO().slice(0, 7)).length
const nameOf = id => EXIDX[id]?.n || workouts.flatMap(w => w.entries).find(e => e.id === id)?.n || id
const nameOf = id => EXIDX[id] ? exerciseNameFor(EXIDX[id]) : (workouts.flatMap(w => w.entries).find(e => e.id === id)?.n || id)
const currentOf = id => {
for (let i = workouts.length - 1; i >= 0; i--) {
const en = workouts[i].entries.find(e => e.id === id)
+5 -5
View File
@@ -6,7 +6,7 @@ import { exOr } from '../lib/exercises.js'
import { effectiveRoutine, lastEntryFor, bestWeightFor, buildSets, freestyleConfig, defaultConfig, setsDoneActive, supersetUnits, unitOf, setLabel, modeOf, isBw, isPerSide, sideReps, repStep, EFFORT, effortOf, stepEffort, capEffort, cascadeWeight, insertWarmupRow, removeRowAt, pairAdjacent, unpairSuperset, cleanupSg } from '../lib/history.js'
import { fmtNum, fmtDate, todayISO, exCount, DAYN } from '../lib/format.js'
import { beep, vibrate } from '../lib/sound.js'
import { t } from '../lib/i18n.js'
import { t, exerciseNameFor } from '../lib/i18n.js'
import { api } from '../lib/api.js'
import { setProgressHighWater, supersetFlowStep } from '../lib/supersetFlow.js'
import Media from '../components/Media.jsx'
@@ -113,7 +113,7 @@ function ExerciseBlock({ entryIdx, compact, onToggle, onField, onAddSet, onRemov
return <>
<Media ex={ex} key={entry.id} compact={compact} minimizable />
<div className="row between" style={{ marginBottom: 6 }}>
<div style={{ fontSize: compact ? 17 : 20, fontWeight: 600, letterSpacing: '-.02em', textTransform: 'capitalize', lineHeight: 1.2 }}>{ex.n}</div>
<div style={{ fontSize: compact ? 17 : 20, fontWeight: 600, letterSpacing: '-.02em', textTransform: 'capitalize', lineHeight: 1.2 }}>{exerciseNameFor(ex)}</div>
<button className="iconbtn" aria-label={t('Details')} onClick={() => exerciseDetailSheet(ex)}><Icon name="info" /></button>
</div>
{!compact && (onPairPrev || onPairNext) && <div className="row" style={{ gap: 6, flexWrap: 'wrap', marginBottom: 8 }}>
@@ -259,7 +259,7 @@ function ActiveWorkout() {
if (!e) return
const hasDone = (e.sets || []).some(s => s.done)
confirmSheet({
title: t('Remove {0}?', exOr(e.id).n),
title: t('Remove {0}?', exerciseNameFor(exOr(e.id))),
message: hasDone
? t('The sets you logged for this exercise in this session will be lost.')
: t('This removes the exercise from your current session.'),
@@ -274,7 +274,7 @@ function ActiveWorkout() {
<div className="muted small" style={{ marginBottom: 12 }}>{t('Which exercise in this superset do you want to remove?')}</div>
<div className="list">
{unit.map(idx => <div key={idx} className="item" onClick={() => { close(); confirmRemoveExercise(idx) }}>
<div className="grow"><div className="tt">{exOr(A.entries[idx]?.id).n}</div></div>
<div className="grow"><div className="tt">{exerciseNameFor(exOr(A.entries[idx]?.id))}</div></div>
<Icon name="chevronRight" />
</div>)}
</div>
@@ -289,7 +289,7 @@ function ActiveWorkout() {
// behave exactly as they do for a reps set.
const startTimed = (idx, i) => {
const e = A.entries[idx]
useUI.getState().startWork(e.sets[i].sec || 45, exOr(e.id).n, elapsed => {
useUI.getState().startWork(e.sets[i].sec || 45, exerciseNameFor(exOr(e.id)), elapsed => {
mutEntry(idx, en => { en.sets[i].sec = elapsed })
if (!useStore.getState().S.active.entries[idx].sets[i].done) toggle(idx, i)
})
+1
View File
@@ -6,6 +6,7 @@
// node scripts/build-instructions.mjs [path-to-exercises.json]
//
// Without an argument the dataset is downloaded from the upstream repo.
// Brazilian Portuguese is curated separately; see instruction-sources/README.md.
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs'
import { dirname, join } from 'node:path'
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env node
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const sourcePath = join(root, 'scripts', 'exercise-name-sources', 'pt-BR.json')
const outputPath = join(root, 'frontend', 'src', 'exercise-names', 'pt-BR.js')
const exercisesPath = join(root, 'frontend', 'src', 'lib', 'exercises-data.js')
const source = JSON.parse(readFileSync(sourcePath, 'utf8'))
const { EXDB } = await import(pathToFileURL(exercisesPath))
const known = new Set(EXDB.map(exercise => exercise.id))
for (const id of Object.keys(source)) {
if (!known.has(id)) throw new Error(`Unknown exercise ID: ${id}`)
if (typeof source[id] !== 'string' || !source[id].trim()) throw new Error(`${id}: name must be a non-empty string`)
}
if (Object.keys(source).length !== EXDB.length) {
throw new Error(`Incomplete pt-BR exercise names: ${Object.keys(source).length}/${EXDB.length}`)
}
const ordered = {}
for (const exercise of EXDB) ordered[exercise.id] = source[exercise.id].trim()
mkdirSync(dirname(outputPath), { recursive: true })
writeFileSync(outputPath, '// generated by scripts/build-pt-br-exercise-names.mjs — edit scripts/exercise-name-sources/pt-BR.json\nexport default ' + JSON.stringify(ordered) + '\n')
console.log(`Generated ${EXDB.length}/${EXDB.length} pt-BR exercise names.`)
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const sourcePath = join(root, 'scripts', 'instruction-sources', 'pt-BR.json')
const outputPath = join(root, 'frontend', 'src', 'instr', 'pt-BR.js')
const exercisesPath = join(root, 'frontend', 'src', 'lib', 'exercises-data.js')
const translations = JSON.parse(readFileSync(sourcePath, 'utf8'))
const { EXDB } = await import(pathToFileURL(exercisesPath))
const exercises = new Map(EXDB.map(exercise => [exercise.id, exercise]))
for (const [id, steps] of Object.entries(translations)) {
const exercise = exercises.get(id)
if (!exercise) throw new Error(`Unknown exercise ID: ${id}`)
if (!Array.isArray(steps) || steps.length === 0) throw new Error(`${id}: translation must contain steps`)
if (steps.length !== exercise.st.length) {
throw new Error(`${id}: expected ${exercise.st.length} steps, received ${steps.length}`)
}
steps.forEach((step, index) => {
if (typeof step !== 'string' || !step.trim()) throw new Error(`${id}: empty step ${index + 1}`)
if (step === exercise.st[index]) throw new Error(`${id}: step ${index + 1} is still English`)
})
}
const ordered = Object.fromEntries(EXDB.filter(exercise => translations[exercise.id]).map(exercise => [exercise.id, translations[exercise.id]]))
writeFileSync(outputPath, '// generated by scripts/build-pt-br-instructions.mjs — edit scripts/instruction-sources/pt-BR.json\nexport default ' + JSON.stringify(ordered) + '\n')
const stepCount = Object.values(ordered).reduce((total, steps) => total + steps.length, 0)
console.log(`${outputPath}: ${Object.keys(ordered).length}/${EXDB.length} exercises, ${stepCount} steps`)
+23
View File
@@ -0,0 +1,23 @@
# Brazilian Portuguese exercise names
`pt-BR.json` is the editable source for the Brazilian Portuguese exercise-name
pack. It maps every built-in EXDB exercise ID to a Portuguese title. The app
combines that title with the unchanged English source at runtime:
```text
Elevação assistida das pernas deitada (assisted lying leg raise)
```
Custom exercise names are never translated. IDs, plan data, workout history,
imports and exports continue to use the canonical catalogue entries.
Generate the runtime pack with:
```sh
node scripts/build-pt-br-exercise-names.mjs
```
The initial translations were produced from the English EXDB titles with LLM
assistance and must not be described as reviewed by a native speaker unless a
named human reviewer completes that review. They are original translations and
were not copied from another Portuguese exercise dataset.
File diff suppressed because it is too large. Load diff
+31
View File
@@ -0,0 +1,31 @@
# Brazilian Portuguese exercise glossary
Preferred terms keep the instruction pack consistent with Brazilian gym usage.
| English | Use in pt-BR | Avoid |
|---|---|---|
| abdomen / abs / engage your core | abdômen / contraia o abdômen | abdómen |
| calf / calves | panturrilha / panturrilhas | gémeos |
| hip | quadril | anca |
| shoulder blade | escápula | omoplata |
| rotator cuff | manguito rotador | coifa dos rotadores |
| dumbbell | halter | peso de mão |
| barbell | barra | barra de peso |
| Smith machine | máquina Smith | barra guiada, unless describing the bar |
| overhand grip | pegada pronada | pegada por cima |
| underhand grip | pegada supinada | pegada invertida / inversa |
| reverse grip | determine from the stated palm direction | pegada invertida / inversa |
| pull-up bar | barra fixa | barra de elevações |
| push-up | flexão de braços | flexão |
| set | série | conjunto |
| repetition / rep | repetição | repetiçãozinha |
| bodyweight | peso corporal | peso do corpo, when used as a category |
| starting position | posição inicial | posição de partida |
| resistance band / band | faixa elástica | banda |
| stability ball | bola de estabilidade | bola suíça |
| floor / ground | chão | piso |
Write instructions using Brazilian `você` conventions and neutral imperative
forms: `mantenha`, `contraia`, `eleve`, `retorne`. Avoid Portuguese (Portugal)
terms such as `ecrã`, `anca`, `abdómen`, `gémeos`, `ginásio` and second-person
forms such as `mantém`, `contrai`, `eleva`, `retorna`.
+50
View File
@@ -0,0 +1,50 @@
# Curated exercise-instruction translations
`pt-BR.json` is the editable source for Brazilian Portuguese exercise
instructions. It is intentionally separate from the upstream-generated packs:
the upstream exercise dataset does not currently ship Portuguese instructions.
## Provenance and review status
The translations are produced from the English instructions in
`frontend/src/lib/exercises-data.js` with language-model assistance from OpenAI
Codex and, for larger structured batches, Anthropic Claude Code. They are
original translations, not copied from another Portuguese exercise dataset.
Each batch is structurally checked against the English source and audited for
Brazilian terminology. It must not be described as native-speaker reviewed
until a named human reviewer has actually completed that review.
The translation policy is meaning-faithful rather than word-for-word: preserve
the number and order of steps, retain the intended movement and safety cues,
and clarify the referenced limb only when the English would otherwise be
ambiguous in Portuguese. Do not silently repair questionable exercise mechanics
from the source dataset; record those separately for upstream correction.
Known source inconsistencies are recorded in `SOURCE_DIVERGENCES.md`.
Add translations in small, reviewable batches. Every translated exercise must
preserve the English instruction-step count. Then regenerate the runtime pack:
```sh
node scripts/build-pt-br-instructions.mjs
```
The generator rejects unknown IDs, empty steps, mismatched step counts and
steps left unchanged in English. The frontend test also verifies that the
generated `frontend/src/instr/pt-BR.js` exactly matches this source.
Do not add `pt-BR` to `INSTR_LANGS` until all 1,324 exercise IDs are translated
and the full automated corpus gates pass. Until then, the released app must
continue to show the honest English-instructions notice instead of silently
mixing Portuguese and English.
Use the terminology in `GLOSSARY.md` for every batch.
For a structured batch, use `scripts/translate-pt-br-stage.mjs` with a dataset
body part and limit. It calls Claude in read-only structured-output mode and
checkpoints only after every returned ID and step count in that batch validates,
so a long stage can resume safely. The normal pack builder and frontend tests
remain mandatory after generation.
Use `--provider=codex` to run the same schema-constrained workflow through an
authenticated Codex CLI when Claude is unavailable. Both providers run without
write tools; only this validator updates the curated JSON after a valid batch.
@@ -0,0 +1,15 @@
# Known English-source divergences
The pt-BR pack preserves the source dataset's exercise identity and step order.
When the English mechanics are internally inconsistent, the translation should
not silently redefine the exercise. Record those cases here for a separate
upstream correction.
| Exercise | English-source issue | pt-BR handling |
|---|---|---|
| `0023` barbell alternate biceps curl | Says to hold a barbell in each hand and later refers to multiple barbells. | Translated faithfully; equipment issue remains upstream. |
| `0984` band lying hip internal rotation | The title says internal rotation, while step 3 directs the knees outward. | Direction translated faithfully. |
| `3667` side lying hip adduction | Step 3 says to engage the adductors while lifting the top leg, which describes abduction. | Muscle cue translated faithfully. |
| `2139` hands bike | Step 2 says to place the feet on pedals of an upper-body ergometer. | Setup translated faithfully. |
| `0987` band one arm single leg split squat | Step 2 says to extend one leg forward but rest that foot on a bench behind the user. | Portuguese clarifies that the other foot rests behind, preserving usable split-squat mechanics; this intentional divergence is documented here. |
| `3294` archer push up | Step 3 says to bend both elbows although the preceding step extends one arm. | Portuguese identifies the supporting arm to avoid an ambiguous unsafe cue; this intentional clarification is documented here. |
@@ -0,0 +1,37 @@
# Brazilian Portuguese instruction translation plan
Translate in schema-validated, checkpointed batches. After a stage, regenerate
the runtime pack and run the frontend suite; after the complete corpus, perform
the independent language/content review. Progress is measured from
`pt-BR.json`, not from generated files.
| Stage | Dataset body part | Total exercises | Order |
|---:|---|---:|---|
| 0 | Foundation sample across categories | 20 translated | Complete |
| 1 | Waist / abs / core | 169 | Complete |
| 2 | Chest / pectorals | 163 | Complete |
| 3 | Back / lats / upper back | 203 | Complete |
| 4 | Shoulders / delts | 143 | Complete |
| 5 | Upper arms / biceps / triceps | 292 | Complete |
| 6 | Lower arms / forearms | 37 | Complete |
| 7 | Upper legs / glutes / quads / hamstrings | 227 | Complete |
| 8 | Lower legs / calves | 59 | Complete |
| 9 | Cardio and neck | 31 | Complete |
| 10 | Full-corpus terminology and independent QA | 1,324 | Ready for review |
The body-part stages cover all 1,324 dataset IDs exactly once. The foundation
sample already contributes to several stages, so stage progress must exclude
IDs already present in the source file. Do not add `pt-BR` to `INSTR_LANGS`
until Stage 10 confirms 1,324/1,324 coverage.
## Checkpoints
- Stage 1 completed in 2026-08-19: 169/169 waist IDs. Combined corpus progress
is 179/1,324 exercises and 996 instruction steps because the foundation
sample also contains 10 exercises from later stages.
- Stages 2–9 completed in 2026-08-19: source coverage reached 1,324/1,324.
Automated Stage 10 gates passed for 7,710/7,710 steps: exact ID and step
coverage, non-empty content, curated-source parity, glossary/English/PT-PT
leakage checks, complete frontend tests and production build. The independent
full-corpus review prompt is prepared separately for Claude Code; do not claim
native-speaker review unless a named human actually performs one.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,87 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process'
import { readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const sourcePath = join(root, 'scripts', 'exercise-name-sources', 'pt-BR.json')
const glossaryPath = join(root, 'scripts', 'instruction-sources', 'GLOSSARY.md')
const exercisesPath = join(root, 'frontend', 'src', 'lib', 'exercises-data.js')
const claude = process.env.CLAUDE_BIN || 'claude'
const option = name => process.argv.find(arg => arg.startsWith(`--${name}=`))?.split('=').slice(1).join('=')
const limit = Number(option('limit') || 1324)
const batchSize = Number(option('batch-size') || 80)
const apply = process.argv.includes('--apply')
if (!Number.isInteger(limit) || limit < 1 || !Number.isInteger(batchSize) || batchSize < 1) {
throw new Error('limit and batch-size must be positive integers')
}
const existing = JSON.parse(readFileSync(sourcePath, 'utf8'))
const glossary = readFileSync(glossaryPath, 'utf8')
const { EXDB } = await import(pathToFileURL(exercisesPath))
const pending = EXDB.filter(exercise => !existing[exercise.id]).slice(0, limit)
const next = { ...existing }
for (let start = 0; start < pending.length; start += batchSize) {
const batch = pending.slice(start, start + batchSize)
const schema = {
type: 'object',
properties: {
translations: {
type: 'array', minItems: batch.length, maxItems: batch.length,
items: {
type: 'object',
properties: { id: { type: 'string' }, name: { type: 'string', minLength: 1 } },
required: ['id', 'name'], additionalProperties: false
}
}
},
required: ['translations'], additionalProperties: false
}
const input = batch.map(({ id, n, bp, eq, tg }) => ({ id, english: n, bodyPart: bp, equipment: eq, target: tg }))
const prompt = `Translate every exercise title below into concise, natural Brazilian Portuguese for a gym app.
Rules:
- Return only the structured JSON required by the schema, with every ID exactly once and in input order.
- Return only the Portuguese title in "name". Do not append or repeat the English title.
- Preserve exercise identity, equipment, stance, grip, direction, side, assisted/weighted status and version qualifiers.
- Prefer established Brazilian gym terminology (for example: supino, agachamento, remada, puxada, rosca, elevação, extensão, flexão de braços, barra fixa, afundo, levantamento terra).
- Keep accepted equipment or exercise names such as kettlebell, Smith, hack squat, leg press and Romanian deadlift when that is the clearest Brazilian usage.
- Use sentence case, not Title Case. Do not use Portuguese (Portugal) terms.
- Do not repair or reinterpret questionable source mechanics; translate the title faithfully.
- Use the metadata only to disambiguate the English title.
GLOSSARY:
${glossary}
INPUT:
${JSON.stringify(input)}`
console.log(`Translating names ${start + 1}-${start + batch.length} of ${pending.length} (${batch[0].id}…${batch.at(-1).id})`)
const result = spawnSync(claude, [
'-p', '--model', 'sonnet', '--effort', 'high', '--no-session-persistence',
'--permission-mode', 'dontAsk', '--disallowedTools', 'Bash', 'Edit', 'Write', 'Read',
'--output-format', 'json', '--max-budget-usd', '2', '--json-schema', JSON.stringify(schema)
], { input: prompt, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 })
if (result.status !== 0) throw new Error(result.stderr || result.stdout || `Claude exited ${result.status}`)
const envelope = JSON.parse(result.stdout)
if (envelope.is_error || !envelope.structured_output) throw new Error(envelope.result || 'Claude returned no structured output')
const rows = envelope.structured_output.translations
const received = new Map(rows.map(row => [row.id, row.name.trim()]))
if (received.size !== batch.length) throw new Error('Claude returned duplicate or missing IDs')
for (const exercise of batch) {
const name = received.get(exercise.id)
if (!name) throw new Error(`${exercise.id}: missing translated name`)
next[exercise.id] = name
}
if (apply) {
writeFileSync(sourcePath, JSON.stringify(next, null, 2) + '\n')
console.log(`Checkpoint: ${Object.keys(next).length}/${EXDB.length} names`)
}
}
if (!apply) console.log(`Validated ${pending.length} names. Re-run with --apply to update the source.`)
else console.log(`Updated ${sourcePath}: ${Object.keys(next).length}/${EXDB.length} names`)
+148
View File
@@ -0,0 +1,148 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process'
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { dirname, join } from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const sourcePath = join(root, 'scripts', 'instruction-sources', 'pt-BR.json')
const glossaryPath = join(root, 'scripts', 'instruction-sources', 'GLOSSARY.md')
const exercisesPath = join(root, 'frontend', 'src', 'lib', 'exercises-data.js')
const claude = process.env.CLAUDE_BIN || 'claude'
const codex = process.env.CODEX_BIN || 'codex'
const stageOrder = ['chest', 'back', 'shoulders', 'upper arms', 'lower arms', 'upper legs', 'lower legs', 'cardio', 'neck']
const option = name => process.argv.find(arg => arg.startsWith(`--${name}=`))?.split('=').slice(1).join('=')
const bodyPart = option('body-part')
const provider = option('provider') || 'claude'
const limit = Number(option('limit') || 10)
const batchSize = Number(option('batch-size') || 10)
const apply = process.argv.includes('--apply')
if (!bodyPart) throw new Error('Usage: translate-pt-br-stage.mjs --body-part=waist|all [--limit=10] [--batch-size=10] [--apply]')
if (!['claude', 'codex'].includes(provider)) throw new Error('provider must be claude or codex')
if (!Number.isInteger(limit) || limit < 1 || !Number.isInteger(batchSize) || batchSize < 1) {
throw new Error('limit and batch-size must be positive integers')
}
const translations = JSON.parse(readFileSync(sourcePath, 'utf8'))
const glossary = readFileSync(glossaryPath, 'utf8')
const { EXDB } = await import(pathToFileURL(exercisesPath))
const requestedParts = bodyPart === 'all' ? stageOrder : [bodyPart]
const pending = requestedParts
.flatMap(part => EXDB.filter(exercise => exercise.bp === part && !translations[exercise.id]))
.slice(0, limit)
if (!pending.length) {
console.log(`No untranslated ${bodyPart} exercises remain.`)
process.exit(0)
}
const next = { ...translations }
for (let start = 0; start < pending.length; start += batchSize) {
const batch = pending.slice(start, start + batchSize)
const schema = {
type: 'object',
properties: {
translations: {
type: 'array', minItems: batch.length, maxItems: batch.length,
items: {
oneOf: batch.map(exercise => ({
type: 'object',
properties: {
id: { const: exercise.id },
steps: { type: 'array', minItems: exercise.st.length, maxItems: exercise.st.length, items: { type: 'string', minLength: 1 } }
},
required: ['id', 'steps'], additionalProperties: false
}))
}
}
},
required: ['translations'], additionalProperties: false
}
const input = batch.map(({ id, n, st }) => ({ id, name: n, steps: st }))
const prompt = `Translate every instruction step below from English into natural Brazilian Portuguese for a fitness app.
Rules:
- Return only the structured JSON required by the schema, with every ID exactly once and in input order.
- Preserve the exact number, order, movement meaning and safety cues of the English steps.
- Use Brazilian você conventions and neutral imperatives: mantenha, contraia, eleve, retorne.
- Follow the glossary. In particular, translate "engage your core/abs" as "contraia o abdômen", never "ative o core".
- Do not use Portuguese (Portugal) wording. Do not add explanations or repair source mechanics.
- Translate only instruction steps; IDs remain unchanged.
GLOSSARY:
${glossary}
INPUT:
${JSON.stringify(input)}`
console.log(`Translating ${start + 1}-${start + batch.length} of ${pending.length} with ${provider} (${batch[0].id}…${batch.at(-1).id})`)
let structured
if (provider === 'claude') {
const result = spawnSync(claude, [
'-p', '--model', 'sonnet', '--effort', 'high', '--no-session-persistence',
'--permission-mode', 'dontAsk', '--disallowedTools', 'Bash', 'Edit', 'Write', 'Read',
'--output-format', 'json', '--max-budget-usd', '2', '--json-schema', JSON.stringify(schema)
], { input: prompt, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 })
if (result.status !== 0) throw new Error(result.stderr || result.stdout || `Claude exited ${result.status}`)
const envelope = JSON.parse(result.stdout)
if (envelope.is_error || !envelope.structured_output) throw new Error(envelope.result || 'Claude returned no structured output')
structured = envelope.structured_output
} else {
const temp = mkdtempSync(join(tmpdir(), 'opengym-pt-br-'))
const schemaPath = join(temp, 'schema.json')
const outputPath = join(temp, 'output.json')
const codexSchema = {
type: 'object',
properties: {
translations: {
type: 'array', minItems: batch.length, maxItems: batch.length,
items: {
type: 'object',
properties: {
id: { type: 'string' },
steps: { type: 'array', items: { type: 'string' } }
},
required: ['id', 'steps'], additionalProperties: false
}
}
},
required: ['translations'], additionalProperties: false
}
try {
writeFileSync(schemaPath, JSON.stringify(codexSchema))
const result = spawnSync(codex, [
'exec', '--skip-git-repo-check', '--ephemeral', '--ignore-user-config',
'--sandbox', 'read-only', '--output-schema', schemaPath,
'--output-last-message', outputPath, '-'
], { input: prompt, encoding: 'utf8', cwd: temp, maxBuffer: 16 * 1024 * 1024 })
if (result.status !== 0) throw new Error(result.stderr || result.stdout || `Codex exited ${result.status}`)
structured = JSON.parse(readFileSync(outputPath, 'utf8'))
} finally {
rmSync(temp, { recursive: true, force: true })
}
}
const rows = structured.translations
const received = new Map(rows.map(row => [row.id, row.steps]))
if (received.size !== batch.length) throw new Error(`${provider} returned duplicate or missing IDs`)
for (const exercise of batch) {
const steps = received.get(exercise.id)
if (!steps || steps.length !== exercise.st.length) throw new Error(`${exercise.id}: invalid step count`)
next[exercise.id] = steps
}
if (apply) {
writeFileSync(sourcePath, JSON.stringify(next, null, 2) + '\n')
console.log(`Checkpoint: ${Object.keys(next).length}/${EXDB.length} exercises`)
}
}
if (!apply) {
console.log(`Validated ${pending.length} translations. Re-run with --apply to update ${sourcePath}.`)
process.exit(0)
}
console.log(`Updated ${sourcePath}: ${Object.keys(next).length}/${EXDB.length} exercises`)
+3 -1
View File
@@ -184,7 +184,9 @@ docker compose up -d</code></pre>
You can start with the app and move to a server later — the backup file migrates everything.</p>
<h3>Where does the exercise database come from?</h3>
<p>From <a href="https://github.com/hasaneyldrm/exercises-dataset" rel="noopener">hasaneyldrm/exercises-dataset</a>:
1,324 exercises with animations and instructions in 10 languages. That dataset licenses the two
1,324 exercises with animations and instructions in 11 languages, including openGym's
separately curated Brazilian Portuguese translation. In pt-BR, built-in exercise names
show Portuguese first and the canonical English title in parentheses. That dataset licenses the two
halves differently, and so does openGym: the exercise metadata and instruction text are
<b>MIT</b>, while the images and animations are
<b>© <a href="https://gymvisual.com/" rel="noopener">Gym visual</a></b>, used under the
+1 -1
View File
@@ -112,7 +112,7 @@
<div class="feat"><div class="ic">🎯</div><h3>Effort per set</h3><p>Rate a set as RIR or RPE — whichever scale you already think in. Optional, and every set keeps the scale it was logged with.</p></div>
<div class="feat"><div class="ic">☀️</div><h3>Screen stays awake</h3><p>No unlocking the phone between sets. The screen stays lit while a workout runs, and lets go the moment you finish.</p></div>
<div class="feat"><div class="ic">📥</div><h3>Bring your history</h3><p>Import from FitNotes, Strong, Hevy — including the RPE they recorded — or body weight straight out of an Apple Health export.</p></div>
<div class="feat"><div class="ic">🌍</div><h3>13 languages</h3><p>Full UI translation, exercise instructions in 10 languages, loaded on demand.</p></div>
<div class="feat"><div class="ic">🌍</div><h3>13 languages</h3><p>Full UI translation, exercise instructions in 11 languages, and bilingual PT-BR exercise names, loaded on demand.</p></div>
<div class="feat"><div class="ic">🔑</div><h3>Passkeys, not passwords</h3><p>Self-hosted profiles sign in with Face ID / fingerprint. Each person's data stays their own.</p></div>
<div class="feat"><div class="ic">🎨</div><h3>Designed, not assembled</h3><p>Light &amp; dark themes, 8 accent colors, a hand-drawn icon set. Looks the same on every phone.</p></div>
<div class="feat"><div class="ic">🔥</div><h3>Warm-up sets</h3><p>Mark the ramp-up rows as warm-ups and they stay out of your 1RM, your progression and the fatigue map — present in the session, absent from the numbers.</p></div>