2024-06-08 12:22:05 -03:00
|
|
|
/*
|
2025-07-23 15:31:12 -03:00
|
|
|
* Copyright (c) 2024-2025, Tim Flynn <trflynn89@ladybird.org>
|
2024-06-08 12:22:05 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Optional.h>
|
|
|
|
|
#include <AK/StringView.h>
|
2025-07-23 15:31:12 -03:00
|
|
|
#include <AK/Utf16String.h>
|
2026-06-21 14:03:06 -03:00
|
|
|
#include <AK/Utf16View.h>
|
2024-06-23 10:14:27 -03:00
|
|
|
#include <LibUnicode/Locale.h>
|
2024-06-25 16:27:20 -03:00
|
|
|
#include <LibUnicode/TimeZone.h>
|
2024-06-08 12:22:05 -03:00
|
|
|
|
2024-06-23 10:14:27 -03:00
|
|
|
namespace Unicode {
|
2024-06-08 12:22:05 -03:00
|
|
|
|
|
|
|
|
enum class LanguageDisplay {
|
|
|
|
|
Standard,
|
|
|
|
|
Dialect,
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-21 14:03:06 -03:00
|
|
|
LanguageDisplay language_display_from_string(Utf16View language_display);
|
2026-06-21 14:03:10 -03:00
|
|
|
Utf16String language_display_to_string(LanguageDisplay language_display);
|
2024-06-08 12:22:05 -03:00
|
|
|
|
Libraries: Clean up UTF-16 source text paths
Store parser errors, source range filenames, source code filenames,
module source, and Rust parser errors as UTF-16 where they flow back
into JavaScript-visible strings. Keep byte-oriented source buffers
byte-backed.
Remove temporary PrimitiveString, ByteString, and UTF-8 detours from
JSON, RegExp, module debug logging, print formatting, and tests.
2026-06-21 14:03:19 -03:00
|
|
|
Optional<Utf16String> language_display_name(StringView locale, StringView language, LanguageDisplay);
|
|
|
|
|
Optional<Utf16String> region_display_name(StringView locale, StringView region);
|
|
|
|
|
Optional<Utf16String> script_display_name(StringView locale, StringView script);
|
|
|
|
|
Optional<Utf16String> calendar_display_name(StringView locale, StringView calendar);
|
|
|
|
|
Optional<Utf16String> date_time_field_display_name(StringView locale, StringView field, Style);
|
2025-07-23 15:31:12 -03:00
|
|
|
Optional<Utf16String> time_zone_display_name(StringView locale, StringView time_zone_identifier, TimeZoneOffset::InDST, double time);
|
Libraries: Clean up UTF-16 source text paths
Store parser errors, source range filenames, source code filenames,
module source, and Rust parser errors as UTF-16 where they flow back
into JavaScript-visible strings. Keep byte-oriented source buffers
byte-backed.
Remove temporary PrimitiveString, ByteString, and UTF-8 detours from
JSON, RegExp, module debug logging, print formatting, and tests.
2026-06-21 14:03:19 -03:00
|
|
|
Optional<Utf16String> currency_display_name(StringView locale, StringView currency, Style);
|
2024-06-08 12:22:05 -03:00
|
|
|
|
|
|
|
|
}
|