mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:17:35 +00:00
LibLocale: Move locale source files to the LibLocale folder
These are still included in LibUnicode, but this updates their location and the include paths of other files which include them.
This commit is contained in:
parent
ff48220dca
commit
43a3471298
48 changed files with 145 additions and 135 deletions
48
Userland/Libraries/LibLocale/PluralRules.cpp
Normal file
48
Userland/Libraries/LibLocale/PluralRules.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibLocale/PluralRules.h>
|
||||
|
||||
namespace Locale {
|
||||
|
||||
PluralForm plural_form_from_string(StringView plural_form)
|
||||
{
|
||||
if (plural_form == "cardinal"sv)
|
||||
return PluralForm::Cardinal;
|
||||
if (plural_form == "ordinal"sv)
|
||||
return PluralForm::Ordinal;
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
StringView plural_form_to_string(PluralForm plural_form)
|
||||
{
|
||||
switch (plural_form) {
|
||||
case PluralForm::Cardinal:
|
||||
return "cardinal"sv;
|
||||
case PluralForm::Ordinal:
|
||||
return "ordinal"sv;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
PluralCategory __attribute__((weak)) determine_plural_category(StringView, PluralForm, PluralOperands)
|
||||
{
|
||||
return PluralCategory::Other;
|
||||
}
|
||||
|
||||
Span<PluralCategory const> __attribute__((weak)) available_plural_categories(StringView, PluralForm)
|
||||
{
|
||||
static constexpr Array<PluralCategory, 1> categories { { PluralCategory::Other } };
|
||||
return categories.span();
|
||||
}
|
||||
|
||||
PluralCategory __attribute__((weak)) determine_plural_range(StringView, PluralCategory, PluralCategory)
|
||||
{
|
||||
return PluralCategory::Other;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue