Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Component: Plural (CLDR plural rules)

Đang mở
#34 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/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ệ
react, tailwindcss, typescript

Hướng nghiên cứu

Start with CONTRIBUTING.md, then look at an existing component in src/registry/components/ and how it is exported from index.ts and registered in src/registry/registry.ts. The new Plural component goes in the same folder and needs tests in test/ for en, ar, pl, ru and ordinal en, plus a page in content/docs/components/. Done means the props interface is exported, those locale cases pass, and the docs page renders.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

component good first issue pluralization

Component: Plural (CLDR plural rules)

Build a small component that picks the right plural form for a count based on the locale's CLDR rules.

Requirements
  • TypeScript-first with exported props interface
  • Uses Intl.PluralRules under the hood (cardinal by default, type="ordinal" supported)
  • Supports all CLDR categories: zero, one, two, few, many, other (other required)
  • Exact-match overrides like =0
  • Optional # placeholder replaced with the locale-formatted number (Intl.NumberFormat)
  • Works as a server-safe render (no state needed)
  • Tailwind CSS compatible
Expected API
<Plural
  count={3}
  locale="ar"
  zero="لا ملفات"
  one="ملف واحد"
  two="ملفان"
  few="# ملفات"
  many="# ملفًا"
  other="# ملف"
/>
Deliverables
  • Component source in src/registry/components/
  • Export in src/registry/components/index.ts and entry in src/registry/registry.ts
  • Tests in test/ covering at least en, ar, pl, ru and ordinal en
  • Documentation page in content/docs/components/

See CONTRIBUTING.md.

Ngôn ngữ chính
TypeScript
Star
39
Fork
16
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của babelize/babelize-elements

Tất cả issue của babelize/babelize-elements

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.