CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

Added Romanian translation #541

Closed mateesville93 closed 3 months ago

mateesville93 commented 6 months ago

Do you have in plan to support Pluralization like Hugo?(Some languages need this): Example for reading time of a post below: English: [reading_time] one = "One minute to read" other = "{{ .Count }} minutes to read"

Romanian: [reading_time] one = "Un minut de citit" few = "{{ .Count }} minute de citit" other = "{{ .Count }} de minute de citit"

bglw commented 5 months ago

Currently Pagefind switches between the zero_results / many_results / one_result translation strings for 0 / 1 / 2+ results.

This won't handle languages with other forms of pluralization, e.g. few vs many — if you have specific rules that would help you here we could add something like a few_results string that can handle a specific number range — let me know what you need :)

mateesville93 commented 5 months ago

Will be nice to have something like this: zero_results / one_results / two_results / few_results / other_results Here is a reference for ranges: https://www.unicode.org/cldr/charts/44/supplemental/language_plural_rules.html#ro Accordingly to Unicode.org: "Languages vary in how they handle plurals of nouns or unit expressions ("hours", "meters", and so on). Some languages have two forms, like English; some languages have only a single form; and some languages have multiple forms (see Slovenian below)."

mateesville93 commented 3 months ago

Someone to merge this PR?

bglw commented 3 months ago

Hey @mateesville93 , sorry for the delay! Merging now, and I'll ping you again when the next release lands.

bglw commented 3 months ago

Released in released in v1.1.0, thanks again!