docs.unity3d.com
    Show / Hide Table of Contents

    Class PluralLocalizationFormatter

    Provides the ability to handle plural forms.

    Inheritance
    Object
    FormatterBase
    PluralLocalizationFormatter
    Inherited Members
    FormatterBase.Names
    Namespace: UnityEngine.Localization.SmartFormat.Extensions
    Syntax
    public class PluralLocalizationFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver, IFormatterLiteralExtractor

    Constructors

    PluralLocalizationFormatter()

    Creates a new instance of the formatter.

    Declaration
    public PluralLocalizationFormatter()

    Properties

    DefaultNames

    Default names to use when Names is null.

    Declaration
    public override string[] DefaultNames { get; }
    Property Value
    Type Description
    String[]
    Overrides
    FormatterBase.DefaultNames

    DefaultTwoLetterISOLanguageName

    The default language to use for plurals if one can not be found.

    Declaration
    public string DefaultTwoLetterISOLanguageName { get; set; }
    Property Value
    Type Description
    String

    Methods

    GetPluralRule(IFormattingInfo)

    Returns the plural rule for the formatting info.

    Declaration
    protected virtual PluralRules.PluralRuleDelegate GetPluralRule(IFormattingInfo formattingInfo)
    Parameters
    Type Name Description
    IFormattingInfo formattingInfo
    Returns
    Type Description
    UnityEngine.Localization.SmartFormat.Utilities.PluralRules.PluralRuleDelegate

    TryEvaluateFormat(IFormattingInfo)

    Writes the current value to the output, using the specified format. IF this extension cannot write the value, returns false, otherwise true.

    Declaration
    public override bool TryEvaluateFormat(IFormattingInfo formattingInfo)
    Parameters
    Type Name Description
    IFormattingInfo formattingInfo
    Returns
    Type Description
    Boolean
    Overrides
    FormatterBase.TryEvaluateFormat(IFormattingInfo)

    WriteAllLiterals(IFormattingInfo)

    Ignores the format arguments and writes every possible literal value. This is used to extract all possible values so that we can determine the distinct characters for font generation etc.

    Declaration
    public void WriteAllLiterals(IFormattingInfo formattingInfo)
    Parameters
    Type Name Description
    IFormattingInfo formattingInfo
    Implements
    IFormatterLiteralExtractor.WriteAllLiterals(IFormattingInfo)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023