Added localization addon
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
{
|
||||
LocalizedString localizedString = localizedHandler.LocalizationProvider[localizedReplyIdentifier];
|
||||
localizedHandler.Container.Response();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user