|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <translations.h>
Public Member Functions | |
| PluralRule ()=default | |
| English's: one form for 1, and the other for any other count. | |
| int | forms () const |
| int | Form (uint64_t n) const |
| The form for the count, from 0. | |
Static Public Member Functions | |
| static absl::StatusOr< PluralRule > | Parse (std::string_view forms) |
How a language picks among a plural's forms by the count, as a PO file's Plural-Forms says, such as Romanian's "nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);": a C expression of n, with ?:, ||, &&, the comparisons, %, numbers and brackets.
Definition at line 21 of file translations.h.
|
default |
English's: one form for 1, and the other for any other count.
| int nanommo::PluralRule::Form | ( | uint64_t | n | ) | const |
The form for the count, from 0.
Definition at line 440 of file translations.cc.
|
inline |
Definition at line 30 of file translations.h.
|
static |
A rule that can't be read, or that picks a form past its last, is refused.
Definition at line 406 of file translations.cc.