or @localizer/format 1.1.1
The or
formats a list of elements by joining them with the word "or," creating a natural and readable output. It is particularly useful for generating human-friendly text from arrays of localized strings or other elements.
Usage
typescript
import { loc } from '@localizer/core';
import { or } from '@localizer/format';
const values = [loc`A`, loc`B`, loc`C`, loc`D`];
const result = or(values);
Demo
Locale | Localized value |
---|---|
en-US | A, B, C, or D |
fr-FR | A, B, C ou D |
de-DE | A, B, C oder D |
fi-FI | A, B, C tai D |
sv-FI | A, B, C eller D |
ko-KR | A, B, C 또는 D |
hi-IN | A, B, C या D |