Translate Text into multiple languages using Asp.Net Core & Csharp

In this article, we are going to learn how to translate text into multiple languages using one of the important Cognitive Services API called Microsoft Translate Text API ( One of the API in Language API ). It's a simple cloud-based machine translation service and obviously we ca

C# (1.5 MB)
305 times
Add to favorites
E-mail Twitter Digg Facebook

Solution explorer

@model TranslateTextApp.Models.LanguageMaster
    ViewData["Title"] = "Translate Text App";

<form asp-controller="Home" asp-action="Index" method="post" class="form-horizontal">
    <div class="form-group">
        <div class="row">
            <h2>Translate Text App</h2>
            <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4">
                <textarea asp-for="Text" rows="5" id="enterText" cols="40" placeholder="Enter text in english"></textarea>
            <div class="col-xs-12 col-sm-6 col-md-6 col-lg-4">
                <label asp-for="LanguageSelection" class="control-label"></label>
                <select asp-items="Model.LanguagePreference" id="ddlLangCode" asp-for="LanguageCode"></select>
            <div class="col-xs-12 col-sm-6 col-md-6 col-lg-2">
                <textarea asp-for="@Model.TranslatedText" id="translatedText" rows="5" disabled cols="40"></textarea>