Computes the plural form from a formula.

See https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html for formulas.

Constructor

new (numForms:Int = 2, formula:String = "n == 1 ? 0 )

Parameters:

numForms

Number of plural forms.

formula

A Haxe expression that accepts a variable n. The expression is parsed and executed using hscript.

Variables

read onlyformulaText:String

read onlynumForms:Int

Methods

getForm (count:Int):Int

Returns the plural form index from the given number.

The index is intended to be used on an array of strings containing the various forms.

Parameters:

count

Number in the range [0, 2147483647].