| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="TranslationService.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.Culture; |
| | | 9 | | |
| | | 10 | | namespace MyNet.Globalization.Localization.Translation; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Current implementation of <see cref="ITranslationService"/> that uses an <see cref="ITranslator"/> to perform transl |
| | | 14 | | /// This service abstracts the translation logic and culture management, allowing for easy localization of applications |
| | | 15 | | /// </summary> |
| | | 16 | | /// <param name="translator">The translator to use for performing translations.</param> |
| | | 17 | | /// <param name="cultureContext">The culture context to use for determining the current culture.</param> |
| | | 18 | | public sealed class TranslationService(ITranslator translator, ICultureContext cultureContext) : ITranslationService |
| | | 19 | | { |
| | | 20 | | /// <inheritdoc /> |
| | 345 | 21 | | public string Translate(string key, TranslationOptions options, CultureInfo? culture = null) => translator.Translate |
| | | 22 | | |
| | | 23 | | /// <inheritdoc /> |
| | 546 | 24 | | public string Translate(string key, TranslationOptions options, string resourceKey, CultureInfo? culture = null) => |
| | | 25 | | } |
| | | 26 | | |