NAME

Unicode::ICU::ListFormatter - List formatting via ICU

SYNOPSIS

# “Hans und Franz”
my $and_list = Unicode::ICU::ListFormatter::format_and(
    'de',   # German
    'Hans',
    'Franz',
);

# “Maedchen oder Weibchen”
my $or_list = Unicode::ICU::ListFormatter::format_or(
    'de',
    'Maedchen',
    'Weibchen',
);

DESCRIPTION

Use this to create properly localized lists. See examples above.

ICU supports more flexible list formatting than this module exposes; more can be added as needed.

COMPATIBILITY

This requires ICU 63 or later.

FUNCTIONS

$str = format_and( $LOCALE, @ELEMENTS )

Formats an “and” list per the given $LOCALE.

$str = format_or( $LOCALE, @ELEMENTS )

Like format_and() but outputs an “or” list. Also requires ICU 67 or later.