Fix: use pluralization correctly (#445)

* feat(billing): add i18n pluralization support for billing unit names

Use i18next plural feature to properly translate and pluralize unit names
in billing plans (e.g., "member" vs "members"). This ensures correct
grammar for phrases like "Up to 4 members included in the plan" and
enables proper translation of unit names in non-English locales.

* fix(billing): handle 'unlimited' tier values in pluralization

Add getSafeCount helper to safely convert tier values to numbers,
preventing NaN when 'unlimited' values are passed to pluralization.
Falls back to plural form for 'unlimited' or invalid values.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Giancarlo Buomprisco
2026-01-18 10:39:40 +01:00
committed by GitHub
parent f3ce70a5b6
commit bebd56238b
2 changed files with 36 additions and 10 deletions

View File

@@ -1,4 +1,8 @@
{
"units": {
"member_one": "member",
"member_other": "members"
},
"subscriptionTabSubheading": "Manage your Subscription and Billing",
"planCardTitle": "Your Plan",
"planCardDescription": "Below are the details of your current plan. You can change your plan or cancel your subscription at any time.",