listFormatter @localizer/format-list 1.1.1
The listFormatter
is a versatile tool designed to format lists of items with customizable options. It allows you to define how list elements are joined together, making it easy to adapt to various localization and formatting requirements.
Usage
typescript
import { loc } from '@localizer/core';
import { listFormatter } from '@localizer/format-list';
const formatter = listFormatter({ delimiter: loc` :: ` });
const values = [loc`A`, loc`B`, loc`C`, loc`D`];
const result = formatter(values);
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | A, B, C, and D |
fr-FR | A, B, C et D |
de-DE | A, B, C und D |
fi-FI | A, B, C ja D |
sv-FI | A, B, C och D |
ko-KR | A, B, C 및 D |
hi-IN | A, B, C, और D |