Refactor: shared locale data module for all locale-aware components
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 40/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, tailwindcss, typescript
調査の方向性
Start by comparing the locale tables in src/registry/components/language-switcher.tsx and src/registry/components/navbar.tsx to see where their coverage and lookup rules differ. Then check src/registry/registry.ts to see how a new registry entry is declared. The work is done when the new src/registry/components/locale-data.ts exports the helpers, both components use it instead of their own tables, and the locale-data unit tests and existing component tests pass.
索引モデルが issue の本文から書いたものです。
説明
Refactor: shared locale data module
LanguageSwitcher and NavBar each carry their own copy of locale display data:
language-switcher.tsx—LANG_TO_FLAG,LANG_NAMES,RTL_LOCALES(~90 languages)navbar.tsx—LOCALE_MAP(~35 languages, label + flag only, no RTL)
The two have drifted (different coverage, different lookup rules), and every new locale-aware component (pill switcher, locale picker, RTL wrapper) will need the same data.
Proposal
- Add
src/registry/components/locale-data.tsexportinggetLocaleLabel(code, mode),getLocaleFlag(code),isRtlLocale(code)and aresolveLocale(locale: Locale)helper that applieslabel/flag/rtloverrides. - Fall back to
Intl.DisplayNamesfor languages not in the built-in table instead of returning the raw code. - Register it in
src/registry/registry.ts(e.g.locale-data) so shadcn installs pull it in as aregistryDependency. - Migrate
LanguageSwitcherandNavBarto it; delete the duplicate tables.
Acceptance
- No locale table left inside individual components
- Unit tests for
locale-data.ts(overrides, region subtags, unknown codes, RTL) - Existing component tests still pass
See ARCHITECTURE.md.
- 主要言語
- TypeScript
- スター
- 39
- フォーク
- 16
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
babelize/babelize-elements のほかの issue
-
bug website
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
babelize/babelize-elements#46 ·
メンテナーはふだん 1 日以内に返信
-
bug language-switcher priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
babelize/babelize-elements#26 ·
メンテナーはふだん 1 日以内に返信
-
component enhancement help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
babelize/babelize-elements#47 ·
メンテナーはふだん 1 日以内に返信
-
bug component rtl-layout
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
babelize/babelize-elements#45 ·
メンテナーはふだん 1 日以内に返信
-
Website: revamp and improve the landing page対応中かも @anjalinayak01 が 4 日前に担当しました。 オープンenhancement help wanted priority: medium website
難易度 4/5 1週間以上 初心者へのやさしさ 30/100
babelize/babelize-elements#37 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
babelize/babelize-elements の issue をすべて見る
似ている issue
-
fix(frontend): correct VITE_IS_DEVELPOMENT typo in shared/app.ts and align dev environment flagsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vicharanashala/ajrasakha#1439 ·
メンテナーはふだん 1 日以内に返信
-
Add: TV5Monde Asieオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
backnotprop/plannotator#1932 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 62/100
ibm-granite/granite.build#504 ·
メンテナーはふだん 2 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#55676 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信