Class PluralForm
Used to determine what version of a translated string should be used when dealing with plurals.
Inheritance
System.Object
PluralForm
Namespace: UnityEngine.Localization
Syntax
public class PluralForm
Properties
Evaluator
Declaration
public PluralForm.EvaluatePluralDelegate Evaluator { get; set; }
Property Value
| Type | Description | 
|---|---|
| PluralForm.EvaluatePluralDelegate | 
NumberOfPlurals
Declaration
public int NumberOfPlurals { get; set; }
Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
CreatePluralForm(String)
Returns a new PluralForm for the locale Code.
Declaration
public static PluralForm CreatePluralForm(string code)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | code | 
Returns
| Type | Description | 
|---|---|
| PluralForm | PluralForm or null if one could not be found.  | 
Evaluate(Int32)
Returns the plural index to use for the value. Plural index values are based on the GNU Gettext standard http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms
Declaration
public virtual int Evaluate(int value)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | value | 
Returns
| Type | Description | 
|---|---|
| System.Int32 | Index of the plural form to use.  | 
GetPluralForm(String)
Returns a PluralForm from the local cache for the code.
Declaration
public static PluralForm GetPluralForm(string code)
Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | code | locale code.  | 
Returns
| Type | Description | 
|---|---|
| PluralForm |