summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-09-05 12:16:35 -0400
committerLinus Groh <mail@linusgroh.de>2021-09-06 15:24:27 +0100
commit12ae0a44d7d801397a1b9ae52728ca021579a494 (patch)
tree29785aeb50168ef3c32a8f5d6ac2638d40206d74 /Userland
parent91db61ae8d5d942df60b09c36d7b0db53ee15ca0 (diff)
downloadserenity-12ae0a44d7d801397a1b9ae52728ca021579a494.zip
LibUnicode: Add public wrapper for the generated locale_from_string
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibUnicode/Locale.cpp9
-rw-r--r--Userland/Libraries/LibUnicode/Locale.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibUnicode/Locale.cpp b/Userland/Libraries/LibUnicode/Locale.cpp
index b1ef307aed..d293e2c493 100644
--- a/Userland/Libraries/LibUnicode/Locale.cpp
+++ b/Userland/Libraries/LibUnicode/Locale.cpp
@@ -753,6 +753,15 @@ bool is_locale_available([[maybe_unused]] StringView locale)
#endif
}
+Optional<Locale> locale_from_string([[maybe_unused]] StringView locale)
+{
+#if ENABLE_UNICODE_DATA
+ return Detail::locale_from_string(locale);
+#else
+ return {};
+#endif
+}
+
Optional<StringView> get_locale_language_mapping([[maybe_unused]] StringView locale, [[maybe_unused]] StringView language)
{
#if ENABLE_UNICODE_DATA
diff --git a/Userland/Libraries/LibUnicode/Locale.h b/Userland/Libraries/LibUnicode/Locale.h
index c1ad458807..3192052996 100644
--- a/Userland/Libraries/LibUnicode/Locale.h
+++ b/Userland/Libraries/LibUnicode/Locale.h
@@ -119,6 +119,7 @@ Optional<String> canonicalize_unicode_locale_id(LocaleID&);
String const& default_locale();
bool is_locale_available(StringView locale);
+Optional<Locale> locale_from_string(StringView locale);
Optional<StringView> get_locale_language_mapping(StringView locale, StringView language);
Optional<StringView> get_locale_territory_mapping(StringView locale, StringView territory);