Skip to content

fix(formplayer): localize progress bar navigation labels - #932

Merged
r0ssing merged 2 commits into
OpenDataEnsemble:devfrom
Lemeri123:locale
Sep 25, 2026
Merged

r0ssing merged 2 commits into
OpenDataEnsemble:devfrom
Lemeri123:locale

Conversation

@Lemeri123

@Lemeri123 Lemeri123 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The progress-bar chevrons now use the same ODE UI locale as the rest of Formplayer.
Screenshot from 2026-09-23 22-55-58

Short description of what changed

In FormProgressBar.tsx, useOdeT() reads the active locale from FormplayerLocaleContext and looks up nav.previousScreen / nav.nextScreen. English fallbacks stay "Previous screen" and "Next screen". Layout, clicks, and disabled states are unchanged. Locale catalog files were not edited.

useOdeT re-renders when the locale changes because it calls useContext(FormplayerLocaleContext). App.tsx puts that provider around the form UI with uiLocale from params.locale. A new locale value makes context consumers re-render, so odeT(locale, key, fallback) runs against the matching en / pt / fr catalog.

Type of Change

  • Bug fix
  • New feature / enhancement
  • Refactor / cleanup
  • Documentation
  • Chore / other

Component(s) Changed

  • formulus-formplayer (form WebView UI)
  • formulus (React Native mobile app)
  • formulus-formplayer (form WebView UI)
  • synkronus (Go backend)
  • synkronus-cli (command-line client)
  • synkronus-portal (web admin UI)

Testing

  • Added/updated tests
  • Added/updated tests
  • Manually tested

Existing English getByLabelText checks still pass because the helper defaults to 'en'. A new case wraps the bar in FormplayerLocaleContext.Provider with 'pt' and asserts Ecrã anterior / Ecrã seguinte (catalog strings, not duplicates). There was no shared i18n test helper; this reuses the same Provider the app already uses.

Checklist

  • Pre-flight checks for changed packages passed (lint / format / tests)
    Verification (from formulus-formplayer/):
    pnpm run lint
    pnpm run format:check
    pnpm test run 220 tests, including 6 in FormProgressBar.test.tsx
    pnpm run build

  • Related issue linked, closes fix(formplayer): localize progress bar navigation labels #907

@najuna-brian najuna-brian changed the title fix(formplayer):localize progress bar navigation labels fix(formplayer): localize progress bar navigation labels Sep 24, 2026
@Mishael-2584
Mishael-2584 self-requested a review September 24, 2026 08:20

@Mishael-2584 Mishael-2584 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good work @Lemeri123

@IamLRBA

IamLRBA commented Sep 25, 2026

Copy link
Copy Markdown
Member

Good work done Lemeri-Boy!

@Lemeri123

Copy link
Copy Markdown
Contributor Author

Thanks @IamLRBA @Mishael-2584

@r0ssing
r0ssing merged commit 546b63b into OpenDataEnsemble:dev Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(formplayer): localize progress bar navigation labels

4 participants