Component: Language Suggestion Banner
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, react, tailwindcss, typescript
- Lĩnh vực
- frontend, internationalization
Hướng nghiên cứu
Read CONTRIBUTING.md and the Contributor Rulebook first, then inspect existing components in src/registry/components/, their exports in src/registry/components/index.ts, registry entries in src/registry/registry.ts, and related tests and docs. Implement the listed banner API and behaviors, following the project conventions. Add the requested tests in test/ and documentation under content/docs/components/language-switchers/; done means the component is registered, documented, and the listed matching, rendering, and dismissal cases are covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Component: Language Suggestion Banner
A slim banner that notices the visitor's browser prefers another language the site supports, and offers to switch: "This page is also available in Deutsch. Switch?"
Requirements
- TypeScript-first with exported props interface
- Reads
navigator.languageson the client and picks the first one that matcheslocales(match the primary subtag too, sode-AT→de) - Renders nothing when the best match is already the current locale, or when nothing matches
- Two actions: switch (calls
onSwitch(code)) and dismiss - Remembers a dismissal in
localStorageunder a configurablestorageKey, so it doesn't come back on every page - Banner text is passed in as props (no hardcoded English), with the suggested language's name shown in that language via
Intl.DisplayNames - No hydration mismatch: render
nulluntil mounted - Accessible:
role="region"with a label, buttons reachable by keyboard - Tailwind CSS compatible, follows the shadcn theme tokens
Expected API
<LanguageSuggestionBanner
locales={[{ code: "en" }, { code: "de" }, { code: "it" }]}
currentLocale="en"
onSwitch={(code) => router.push(`/${code}`)}
labels={{
message: (language) => `This page is also available in ${language}.`,
switch: "Switch",
dismiss: "Dismiss",
}}
/>
Deliverables
- Component source in
src/registry/components/ - Export in
src/registry/components/index.tsand entry insrc/registry/registry.ts - Tests in
test/covering: exact match, subtag match (de-AT), no match, already-current locale, dismissal persisted - Documentation page in
content/docs/components/language-switchers/
See CONTRIBUTING.md and the Contributor Rulebook.
- Ngôn ngữ chính
- TypeScript
- Star
- 39
- Fork
- 16
- Merge trung bình
- 18 giờ 14 phút
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của babelize/babelize-elements
-
accessibility help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
babelize/babelize-elements#94 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
babelize/babelize-elements#93 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Relative TimeĐang mởcomponent date-time good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
babelize/babelize-elements#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Timezone PickerĐang mởcomponent date-time good first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
babelize/babelize-elements#91 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component enhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
babelize/babelize-elements#47 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của babelize/babelize-elements
Issue tương tự
-
Add: Yichang TVĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
vtselect: data race in Tempo search tags APIs for invalid TraceQL queriesCó thể đã có người làm @Shubham19032004 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
VictoriaMetrics/VictoriaTraces#304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: claim-conflict drop leaves both facts active and is never re-proposed (untested review cell)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-pull-request-github#9159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Usage page should show API-equivalent cost and say when a connected plan shows info onlyĐang mởenhancement from-x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
nightly-labs/openbot#4867 ·
Maintainer thường phản hồi trong vòng 1 ngày