Add support for plural forms

This commit is contained in:
mniip
2020-03-24 19:01:51 +03:00
parent a16a4936a5
commit bb4f242e0b
5 changed files with 83 additions and 10 deletions

View File

@@ -6,9 +6,16 @@ struct LocaleEN : public Locale
{
String GetName() const { return "English"_ascii; }
size_t GetPluralIndex(size_t n) const
{
// 0: singular, 1: plural
return n == 1 ? 0 : 1;
}
void Set() const
{
using i18n::translation;
using i18n::pluralForm;
}
String GetIntroText() const
@@ -132,7 +139,6 @@ struct LocaleEN : public Locale
"\n"
"If you have any questions about what is and isn't against the rules, feel free to contact a moderator.";
}
};
Locale const &Locale_EN = LocaleEN{};

View File

@@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include "common/Localization.h"
extern Locale const &Locale_EN;