logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class LocalePreviewMatcher

    Pure decision logic for picking which translation candidate best previews a selected locale.

    Inheritance
    object
    LocalePreviewMatcher
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Shared.Utils
    Assembly: Serenity.Shared.dll
    Syntax
    public static class LocalePreviewMatcher

    Methods

    SelectBestTranslation(string, IEnumerable<(string localeCode, string value)>)

    Picks the best translation for selectedLocaleCode among candidates: an exact locale-code match (case-insensitive) wins; otherwise an English-prefixed locale ("en..."); otherwise the first candidate with a non-empty value; otherwise null.

    Declaration
    public static string SelectBestTranslation(string selectedLocaleCode, IEnumerable<(string localeCode, string value)> candidates)
    Parameters
    Type Name Description
    string selectedLocaleCode
    IEnumerable<(string localeCode, string value)> candidates
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved