Search Results for

    Show / Hide Table of Contents

    Class ErrorLocalizer

    The default IErrorLocalizer. For each culture from the wanted one up to its neutral parent (ar-EG → ar) it asks every IErrorMessageSource in order (the app's first, so apps can override package texts); then the sources' neutral (English) text; then Message. Named placeholders ({Field}) are filled from Arguments, formatted for the wanted culture; unknown ones stay as written.

    Inheritance
    object
    ErrorLocalizer
    Implements
    IErrorLocalizer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ZhEaIsNsAaBn.Utilities
    Assembly: ZhEaIsNsAaBn.LayerResponse.dll
    Syntax
    public sealed class ErrorLocalizer : IErrorLocalizer
    Remarks

    Transitional: while error catalogs still carry MessageAR, it is used as the ar text when no source has one.

    Constructors

    ErrorLocalizer(IEnumerable<IErrorMessageSource>)

    Creates the localizer.

    Declaration
    public ErrorLocalizer(IEnumerable<IErrorMessageSource> sources)
    Parameters
    Type Name Description
    IEnumerable<IErrorMessageSource> sources

    The message sources, highest priority first. May be empty.

    Exceptions
    Type Condition
    ArgumentNullException

    sources is null.

    Fields

    NeutralLocale

    The language of neutral resources and of Message.

    Declaration
    public const string NeutralLocale = "en"
    Field Value
    Type Description
    string

    Methods

    Localize(Error)

    The message in CurrentUICulture (set per request by request localization).

    Declaration
    public LocalizedMessage Localize(Error error)
    Parameters
    Type Name Description
    Error error

    The error.

    Returns
    Type Description
    LocalizedMessage

    The message and the locale it is really in.

    Exceptions
    Type Condition
    ArgumentNullException

    error is null.

    Localize(Error, CultureInfo)

    The message in culture, falling back to its parent cultures, then English.

    Declaration
    public LocalizedMessage Localize(Error error, CultureInfo culture)
    Parameters
    Type Name Description
    Error error

    The error.

    CultureInfo culture

    The wanted culture, e.g. ar-EG.

    Returns
    Type Description
    LocalizedMessage

    The message and the locale it is really in.

    Exceptions
    Type Condition
    ArgumentNullException

    error or culture is null.

    Implements

    IErrorLocalizer
    In this article
    Back to top Generated by DocFX