dotnet add package Diplo.Translator --version 10.0.1
NuGet\Install-Package Diplo.Translator -Version 10.0.1
<PackageReference Include="Diplo.Translator" Version="10.0.1" />
paket add Diplo.Translator --version 10.0.1
#r "nuget: Diplo.Translator, 10.0.1"
// Install Diplo.Translator as a Cake Addin
// Install Diplo.Translator as a Cake Tool
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.
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:
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.
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!).
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.
Video Demo: https://www.youtube.com/shorts/1R8QtCBkyEk
Download & Install
dotnet add package Diplo.Translator
Get in Touch
You can reach me (Dan 'Diplo' Booth) at:
Our Umbraco: https://our.umbraco.com/members/DanDiplo/
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!
|Versions Compatible and additional computed target framework versions.
|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.
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
Umbraco marketplace compatability