Class CustomPluralRuleProvider
Use this class to provide custom plural rules to Smart.Format
Namespace: UnityEngine.Localization.SmartFormat.Extensions
Syntax
public class CustomPluralRuleProvider : IFormatProvider
Constructors
CustomPluralRuleProvider(PluralRules.PluralRuleDelegate)
Creates a new instance of the plural rule provider.
Declaration
public CustomPluralRuleProvider(PluralRules.PluralRuleDelegate pluralRule)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Localization.SmartFormat.Utilities.PluralRules.PluralRuleDelegate | pluralRule | The plural rule to use for this provider. |
Methods
GetFormat(Type)
Returns the formatter when formatType
is CustomPluralRuleProvider, otherwise returns null
.
Declaration
public object GetFormat(Type formatType)
Parameters
Type | Name | Description |
---|---|---|
Type | formatType |
Returns
Type | Description |
---|---|
Object |
GetPluralRule()
Returns the custom plural rule delegate.
Declaration
public PluralRules.PluralRuleDelegate GetPluralRule()
Returns
Type | Description |
---|---|
UnityEngine.Localization.SmartFormat.Utilities.PluralRules.PluralRuleDelegate |