Class LocalePreviewMatcher
Pure decision logic for picking which translation candidate best previews a selected locale.
Inherited Members
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 |