Localize .NET Applications with Machine-Translation

Localize .NET Applications with Machine-Translation

Introducing a Machine Translator that creates GitHub Action for .NET localization allowing you to build, test, and deploy your code. With the Machine Translator GitHub Action, you configure a workflow to automatically create pull requests as translation source file change. Localize .NET applications with machine-translation.

In this post, I’m going to introduce you to a GitHub Action that creates machine-translations for .NET localization. GitHub Actions allow you to build, test, and deploy your code right from GitHub, but they also allow for other workflows. You can perform nearly any action imaginable against your source code as it evolves. With the Machine Translator GitHub Action, you configure a workflow to automatically create pull requests as translation source file change.

You can use  localization with Blazor WebAssembly (Wasm) to change the displayed language of a rendered website. Localization support in .NET is nothing new. It’s possible with translation files, for example, *.{locale}.resx*.{locale}.xliff, or *.{locale}.restext to name a few. The CultureInfo class is used along with these translation files and various other .NET employed mechanics. However, maintaining translation files can be tedious and time-consuming. With GitHub Actions and  Azure Cognitive Services Translator, you can set up a workflow to automatically create pull requests that provide machine-translated files.

Azure Cognitive Services Translator

Cognitive Services Translator is a cloud-based machine translation service from Azure. It powers the GitHub Action, providing the root translation functionality. To use the action, you will need a  Cognitive Services Translator resource. You can use an existing one, or  create a new one. If you do not have an Azure account, you can  create one for free. This resource is used to perform the translations from the GitHub Action through the  Translator API v3. In other words, as you push code changes to your GitHub repository that include *.en.resx files, this action runs when correctly specified in the workflow.

For more information on filtering when actions run due to changes in specific files, see  Workflow syntax for GitHub Actions.

Machine Translator GitHub Action

The Machine Translator GitHub Action is available on the  GitHub action marketplace. This GitHub Action does the work of marrying the functionality of the Cognitive Services Translator with your source files. To use this action, you’ll need to  create a GitHub workflow. There are a few required inputs (and some optional), most of which are from your  Azure Translator resource:

TypeInput nameExample / DescriptionRequiredsourceLocale'en' The source locale to translate from.RequiredsubscriptionKey'c571d5d8xxxxxxxxxxxxxxxxxx56bac3' Cognitive Services Translator subscription key, ideally stored as secret.Requiredendpoint'https://api.cognitive.microsofttranslator.com/' Cognitive Services Translator endpoint, ideally stored as secret.Optionalregion'canadacentral' Cognitive Services Translator region, ideally stored as secret. Optional when using a global translator resource.OptionaltoLocales'"es,de,fr"' or '["es","de","fr"]' Limit the scope of the translation targets. If not provided, uses all possible translation targets.

Additionally, the action requires a GITHUB_TOKEN as an environment variable. GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow as an encrypted secret. To define this environment variable, use the following YAML within your workflow (more on this later):


For more information, see  GitHub Actions: Authentication in a workflow .

.net asp.net azure azure github

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

jQuery Ajax CRUD in ASP.NET Core MVC with Modal Popup

In this article, we’ll discuss how to use jQuery Ajax for ASP.NET Core MVC CRUD Operations using Bootstrap Modal. With jQuery Ajax, we can make HTTP request to controller action methods without reloading the entire page, like a single page application.

Hire ASP.Net Developers

Looking to outsource your asp dot net development requirement? ASP.Net is a special feature of the DOT Net framework created by Microsoft. At [HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io"), we have a team of experienced...

MVC User Registration & Login with ASP.NET Core Identity

In this article, we will discuss the quickest way to use ASP.NET Core Identity for User Login and Registration in a new or existing MVC application.

Hire Dedicated ASP.NET Developers | ASP.NET Web Development Company

Our ASP.NET web development team has latest technological expertise and follows industry best practices to ensure that the deliverables are reliable and scalable.

Using Azure AD groups authorization in ASP.NET Core for an Azure Blob Storage

This post show how Azure AD groups could be used to implement authorization for an Azure Blob storage and used in an ASP.NET Core Razor page application to authorize the identities. The groups are assigned the roles in the Azure Storage. Azure AD users are added to the Azure AD groups and inherit the group roles. The group ID is added to the claims of the tokens which can be used for authorization in the client application.