Skip to content

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

LocaleLocalized value
en-US  American EnglishA, B, C, or D
fr-FR  French (France)A, B, C ou D
de-DE  German (Germany)A, B, C oder D
fi-FI  Finnish (Finland)A, B, C tai D
sv-FI  Swedish (Finland)A, B, C eller D
ko-KR  Korean (South Korea)A, B, C 또는 D
hi-IN  Hindi (India)A, B, C या D

See also