mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:57:34 +00:00
LibJS: Implement a nearly empty Intl.PluralRules object
This adds plumbing for the Intl.PluralRules object, constructor, and prototype.
This commit is contained in:
parent
ac3e42a8de
commit
0087804d10
12 changed files with 229 additions and 0 deletions
36
Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h
Normal file
36
Userland/Libraries/LibJS/Runtime/Intl/PluralRules.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Runtime/Intl/NumberFormat.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
namespace JS::Intl {
|
||||
|
||||
class PluralRules final : public NumberFormatBase {
|
||||
JS_OBJECT(PluralRules, NumberFormatBase);
|
||||
|
||||
public:
|
||||
enum class Type {
|
||||
Cardinal,
|
||||
Ordinal,
|
||||
};
|
||||
|
||||
PluralRules(Object& prototype);
|
||||
virtual ~PluralRules() override = default;
|
||||
|
||||
Type type() const { return m_type; }
|
||||
StringView type_string() const;
|
||||
void set_type(StringView type);
|
||||
|
||||
private:
|
||||
Type m_type { Type::Cardinal }; // [[Type]]
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue