示例#1
0
        public async Task SendMessageAsync(ITurnContext turnContext, string message)
        {
            var state = await Accessors.CustomerDataState.GetAsync(turnContext);

            if (state.ChoosenLanguage != null)
            {
                var text = await Translator.TranslateText(message, state.ChoosenLanguage);

                await turnContext.SendActivityAsync(MessageFactory.Text(text));
            }
            else
            {
                await turnContext.SendActivityAsync(MessageFactory.Text(message));
            }
        }
示例#2
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            string strContent = output.GetChildContentAsync().Result.GetContent();

            output.Content.AppendHtml(_ITextTranslator.TranslateText(strContent));
        }