Generalize the report EN/עב language toggle and useReportLang hook
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- developer-experience, frontend
Research direction
The proposed files are packages/client/src/components/screens/reports/depreciation-report/report-lang-toggle.tsx and use-report-lang.ts; first read those changes in PR #5232 and the depreciation i18n.ts. Compare the landing page's landing-i18n.tsx and landing-nav.tsx to decide whether its localStorage-based language state should use the shared toggle. Migrate the depreciation report while preserving ?lang=he, replace navigation and coexistence with depreciationReportFilters, then run the existing tests from #5232.
Written by the indexing model from the issue text.
Description
Context
PR https://github.com/Urigo/accounter-fullstack/pull/5232 adds an EN | עב toggle to the depreciation report screen, plus a hook that keeps the language in the ?lang= URL param. Both are typed to the depreciation module and cannot be reused as they are. Other screens already have bilingual output, so the toggle and hook should be shared.
Files (as added by #5232):
packages/client/src/components/screens/reports/depreciation-report/report-lang-toggle.tsx:ReportLangToggle. The options are hard-coded toENandעב, and the type comes from the depreciationi18n.ts.packages/client/src/components/screens/reports/depreciation-report/use-report-lang.ts:useReportLang. It usesparseReportLangandREPORT_LANG_QUERY_PARAMfrom the depreciationi18n.ts.
Existing bilingual code to account for
- Landing page (
packages/client/src/components/landing/):LandingLangProviderinlanding-i18n.tsxkeeps the language in React context backed bylocalStorage(Hebrew default). Its toggle is inline inlanding-nav.tsx. This is a different mechanism from the URL-based hook. BilingualLabel(reports/securities-semi-annual-report/declaration-line.tsx): a label component with no state. It is not a toggle.- RTL wrappers (
dir="rtl"/lang="he") inshaam-6111-report/*,form-1214-report/declarations-editor.tsx,securities-semi-annual-report/*andbusiness/israeli-corporation-lookup.tsx: per-screen, with no shared switch.
Proposed work
- Move a generic toggle to a shared location (e.g.
components/uiorcomponents/common). Take the options and labels as props, and make the language type a generic parameter. - Parameterize the hook by query param name and default value, so each screen can keep its own param.
- Migrate the depreciation report to the shared pieces, with no change in behavior or tests.
- Evaluate the landing page's
LandingLangProvideras a second consumer. Its persistence (localStorage) differs from URL state, so decide whether to unify or keep both. - Adopt the shared toggle only on screens that have a language switch. The RTL-only screens do not need it.
Acceptance criteria
- The depreciation report's URL behavior is unchanged:
?lang=heworks, navigation usesreplace, and the hook coexists with thedepreciationReportFiltersparam. - Existing tests from #5232 still pass.
Notes
Depends on #5232 merging first, since the files it describes exist only on that PR's branch.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 10
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 276
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Urigo/accounter-fullstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Urigo/accounter-fullstack#5302 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Urigo/accounter-fullstack#5257 ·
Maintainers usually reply within 2 days
-
1214 annual-audit-workflow
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#5256 ·
Maintainers usually reply within 2 days
-
annual-audit-workflow
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
Urigo/accounter-fullstack#5252 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Urigo/accounter-fullstack#4919 ·
Maintainers usually reply within 2 days
All issues in Urigo/accounter-fullstack
Similar issues
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day