Skip to content

fix(i18n): pluralize units (1 lata vs 3 latas)#116

Merged
Endika merged 1 commit into
mainfrom
fix/unit-plurals
May 28, 2026
Merged

fix(i18n): pluralize units (1 lata vs 3 latas)#116
Endika merged 1 commit into
mainfrom
fix/unit-plurals

Conversation

@Endika
Copy link
Copy Markdown
Owner

@Endika Endika commented May 28, 2026

Summary

Wires i18next's built-in plural support so unit labels render the correct singular/plural form based on quantity. Previously the UI always showed plural ("1 latas"), now it shows "1 lata" / "3 latas" correctly.

  • displayUnit(unit, t, count?) now takes an optional count and passes it to t() for plural lookup. Without count it returns the base plural (used for dropdown labels).
  • Updated 5 call sites to pass quantity: formatShoppingListText, ConsumptionSummary, ExpenseForm, and 2 spots in PurchasesTab.
  • All 6 locales (ca / en / es / eu / gl / va) gained _one and _other keys for: units, bottles, cans, liters, grams, bag, tray. kg and single stay invariant. Base plural keys preserved for backward-compatible dropdown rendering.

Test plan

  • Open share modal with an item of 1 botella and another of 3 botellas → singular/plural in each line
  • "Lo que te toca" detail list with mixed quantities → same
  • Switch locale → plurals correct in each language

@Endika Endika merged commit fbde331 into main May 28, 2026
1 check passed
@Endika Endika deleted the fix/unit-plurals branch May 28, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant