Diplo.Translator 10.0.1

dotnet add package Diplo.Translator --version 10.0.1
NuGet\Install-Package Diplo.Translator -Version 10.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Diplo.Translator" Version="10.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Diplo.Translator --version 10.0.1
#r "nuget: Diplo.Translator, 10.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Diplo.Translator as a Cake Addin
#addin nuget:?package=Diplo.Translator&version=10.0.1

// Install Diplo.Translator as a Cake Tool
#tool nuget:?package=Diplo.Translator&version=10.0.1

Diplo Translator for Umbraco

This is package for Umbraco 10 CMS that adds a Translate option to the Umbraco Dictionary within the Translation tree. This option can be used to automatically translate all the empty dictionary items in the tree from the selected language using an AI-based translation service. By default this is Microsoft Translator. In future other providers may be supported.

Set Up

Microsoft Translator (Azure)

To use this package you will need a Microsoft Azure subscription (which can be set-up for free) and to have created a Translator resource within the Azure Portal. You can use the free pricing tier (F0) for the service which will suffice for most use cases.

Full instructions can be found online in the Azure documentation Create a Translator resource.

Once you have done this you will have access to:

  • The API endpoint URL of your translator service
  • An API key

You will need to configure these settings in the Umbraco site that you have installed the package to. The simplest way to do this is add them to the appsettings.json file in Umbraco like this:

"Diplo.Translator": {
    "TranslatorApiEndpoint": "https://api.cognitive.microsofttranslator.com/",
    "TranslatorApiKey": "your-api-key-goes-here"
  }

You could also set your API credentials as secrets, as outlined in the article Safe storage of app secrets in development in ASP.NET Core.

Usage

Once installed and configured (see above) you will be able to go to the Translation section in Umbraco where you find the Dictionary. Within here you can right-click on the ... to select the new Translate option in the menu:

Translate Menu

This will then take you to the Translate dialog:

Translate Dialog

Here you can choose your options for how the dictionary items will be translated:

  • Translate From - Use this to select the language to translate from (the default language for your site will be chosen first)
  • Overwrite - select whether to ignore existing values (ie. ones that already have translations) or to overwrite them. Be careful if overwriting as this will overwrite items that already have a translation and replace it with the AI translation.

Then click the Translate button and the system will translate the dictionary items from the selected language (you will need to have added the values for this language for this to work as it obviously requires some text to translate from!).

For Example

If you have a site with 3 languages: English (default), French and German then you will need to complete the values for all the English dictionary keys to translate from that language. Once you have completed those, clicking Translate will translate all the French and German values using the AI translation service.

  • If an item already has a value for a language it will be skipped unless you explicitly select Overwrite existing values.

  • If the item being translated doesn't have a value for the language being translated from it will be skipped.

Note: Whilst Microsoft Translator supports most languages there may be instances where it is not able to translate if it doesn't recognise a language. See https://www.microsoft.com/en-us/translator/languages/ for supported languages.

Demo

Video Demo: https://www.youtube.com/shorts/1R8QtCBkyEk

Blog Post: https://www.diplo.co.uk/blog/web-development/diplo-translator-for-umbraco/

Download & Install

NuGet: https://www.nuget.org/packages/Diplo.Translator/

dotnet add package Diplo.Translator

Get in Touch

You can reach me (Dan 'Diplo' Booth) at:

Credits

The signalR code was blatantly "borrowed" and adapted from code the fabulous Kevin Jump wrote for uSync. Not only is uSync an awesome product, but a great place to learn how to build complex integrations with Umbraco. Thanks, Kevin!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.0.1 396 11/28/2022
10.0.0 467 7/6/2022

Umbraco marketplace compatability