Generalize the report EN/עב language toggle and useReportLang hook
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 30
- フォーク
- 10
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 276
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Urigo/accounter-fullstack のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Urigo/accounter-fullstack#5302 ·
メンテナーはふだん 2 日以内に返信
-
1214 annual-audit-workflow
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Urigo/accounter-fullstack#5257 ·
メンテナーはふだん 2 日以内に返信
-
1214 annual-audit-workflow
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Urigo/accounter-fullstack#5256 ·
メンテナーはふだん 2 日以内に返信
-
annual-audit-workflow
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
Urigo/accounter-fullstack#5252 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Urigo/accounter-fullstack#4919 ·
メンテナーはふだん 2 日以内に返信
Urigo/accounter-fullstack の issue をすべて見る
似ている issue
-
area: integrations documentation priority: P2 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eddiejaoude/StackDash#798 ·
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:midnight-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
midnightntwrk/midnight-js#1790 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:vscode bug has repro platform:macos platform:vscode regression
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信