Skip to content

uiPlural

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/web/src/app/p/[slugId]/components/uiStrings.ts

Simple one/other pluralization over <base>_one / <base>_other keys. (Approximation for languages with richer plural rules — good enough for viewer chrome; counts are also shown as digits.)

Signature

ts
function uiPlural(lang: string | null | undefined, base: | 'resultCount'
    | 'documentCount'
    | 'categoryCount'
    | 'documentsAvailable'
    | 'articleCount', n: number): string

Parameters

NameType
lang`string
base`
| 'documentCount'
| 'categoryCount'
| 'documentsAvailable'
| 'articleCount'` |

| n | number |

Returns: string

Was this page helpful?

Download as PDF