Files
ladybird/Userland/Libraries/LibLocale/ListFormat.h
Timothy Flynn 5f7251fd91 LibJS+LibLocale: Replace list formatting with ICU
This also largely eliminates the need for some ECMA-402 AOs, as is it
all handled internally by ICU (which the spec is basically based on).
2024-06-09 10:47:28 +02:00

33 lines
719 B
C++

/*
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibLocale/Locale.h>
namespace Locale {
enum class ListFormatType {
Conjunction,
Disjunction,
Unit,
};
ListFormatType list_format_type_from_string(StringView list_format_type);
StringView list_format_type_to_string(ListFormatType list_format_type);
struct ListFormatPart {
StringView type;
String value;
};
String format_list(StringView locale, ListFormatType, Style, ReadonlySpan<String> list);
Vector<ListFormatPart> format_list_to_parts(StringView locale, ListFormatType, Style, ReadonlySpan<String> list);
}