| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="CountryDisplayTextStrategy.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System.Globalization; |
| | | 8 | | using MyNet.Globalization.Localization.Translation; |
| | | 9 | | using MyNet.Globalization.Localization.Translation.KeyGeneration; |
| | | 10 | | using MyNet.Humanizer.Display.Strategies; |
| | | 11 | | |
| | | 12 | | namespace MyNet.Geography.Localization.Providers; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Provides localized display names for Country values, using a resource manager to retrieve the appropriate display na |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="translationService">The translation service used to retrieve localized strings.</param> |
| | | 18 | | /// <param name="keyProvider">The key provider used to generate translation keys.</param> |
| | 12 | 19 | | public sealed class CountryDisplayTextStrategy(ITranslationService translationService, ITranslationKeyProvider keyProvid |
| | | 20 | | { |
| | | 21 | | /// <inheritdoc /> |
| | 3 | 22 | | protected override string? ProvideSymbol(Country value, CultureInfo culture) => null; |
| | | 23 | | |
| | | 24 | | /// <inheritdoc /> |
| | 12 | 25 | | protected override string? ProvideDisplayText(Country value, CultureInfo culture) => CountryResources.ResourceManage |
| | | 26 | | |
| | | 27 | | /// <inheritdoc /> |
| | 0 | 28 | | protected override string ProvideFallback(Country value, CultureInfo culture) => value.Name; |
| | | 29 | | } |
| | | 30 | | |