2026-02-27 19:18:18 +04:00
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Telegram.Bot.Types;
|
|
|
|
|
using Telegrator.Handlers;
|
|
|
|
|
|
|
|
|
|
namespace Telegrator.Localized
|
|
|
|
|
{
|
|
|
|
|
public static class LocalizedMessageHandlerExtensions
|
|
|
|
|
{
|
|
|
|
|
public static async Task<Message> ResponseLocalized(this ILocalizedHandler<Message> localizedHandler, string localizedReplyIdentifier, params IEnumerable<string> formatArgs)
|
|
|
|
|
{
|
2026-03-06 20:49:32 +04:00
|
|
|
LocalizedString localizedString = localizedHandler.LocalizationProvider[localizedReplyIdentifier, formatArgs];
|
|
|
|
|
return await localizedHandler.Container.Responce(localizedString.Value);
|
2026-02-27 19:18:18 +04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|