bloom-housing / ui-components

0 stars 2 forks source link

Language Pluralization #150

Closed cliu02 closed 1 month ago

cliu02 commented 4 months ago

Background: This issue comes from DAHLIA ticket DAH-2276 to fix DAHLIA bugs where different languages do not correctly display pluralization. For example, in English the string "Up to X units" should instead note "Up to 1 unit" if non-pluralized according to English language rules. DAHLIA has certain areas in the web application where there is an attempt to manually implement pluralizations, but there is complexity given how different languages have different pluralization rules. There is a request for a standard pluralization implementation.

Description: Bloom UIC already uses the node-polygot npm package. This ticket is to implement the node-polyglot pluralization feature in the Bloom UIC translator. After implementation, strings should change depending on the specific language and its pluralization rules. For example, if the Bloom UIC translator is given the locale of English, then the string "Up to X units" should instead be "Up to 1 unit" if there is only one unit. This will ensure that DAHLIA and other Bloom UIC consumers have accurate language pluralization in multi-language content.

This screenshot is an example of an area with pluralization bugs ("1 units" and "1 applicants are"): Screenshot 2024-04-22 at 10 07 35 AM

sarahlazarich commented 4 months ago

@emilyjablonski and @cliu02 to sync on defining the issue