Diplo.Translator
10.0.0
See the version list below for details.
dotnet add package Diplo.Translator --version 10.0.0
NuGet\Install-Package Diplo.Translator -Version 10.0.0
<PackageReference Include="Diplo.Translator" Version="10.0.0" />
paket add Diplo.Translator --version 10.0.0
#r "nuget: Diplo.Translator, 10.0.0"
// Install Diplo.Translator as a Cake Addin #addin nuget:?package=Diplo.Translator&version=10.0.0 // Install Diplo.Translator as a Cake Tool #tool nuget:?package=Diplo.Translator&version=10.0.0
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:
This will then take you to the 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
You can view a video demo of the concept at: https://www.youtube.com/shorts/1R8QtCBkyEk
Get in Touch
You can reach me (Dan 'Diplo' Booth) at:
Twitter: https://twitter.com/DanDiplo
Our Umbraco: https://our.umbraco.com/members/DanDiplo/
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 | Versions 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. |
-
net6.0
- Umbraco.Cms.Web.BackOffice (>= 10.0.1)
- Umbraco.Cms.Web.Website (>= 10.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release for Umbraco 10 with Microsoft Translator integration.