DocLanguageTranslator 1.39.0
dotnet tool install --global DocLanguageTranslator --version 1.39.0
dotnet new tool-manifest
dotnet tool install --local DocLanguageTranslator --version 1.39.0
#tool dotnet:?package=DocLanguageTranslator&version=1.39.0
nuke :add-package DocLanguageTranslator --version 1.39.0
Translate documentation pages for DocFX
This tool allows to generate and translate automatically missing files or identify missing files in multi language pattern directories. The pattern that should be followed by end user documentation is the following:
/userdocs
/.attachments
picture-en.jpg
picture-de.jpg
photo.pgn
otherdoc.pptx
/en
index.md
/plant-production
morefiles.md
and-more.md
/de
.override
index.md
/plant-production
morefiles.md
and-more.md
/zh-Hans
.override
index.md
/plant-production
morefiles.md
and-more.md
index.md
toc.yml
As for the rest of the documentation, all attachments should be in the .attachments folder and all sub folder directories should match a language international code. In the previous example, en for English, de for German, and zh-Hans for Chinese (Simplified).
All the Markdown's file names must be the same in all the sub directories. This tool can check the integrity as well as automatically creating the missing files and translate them at the same time.
Usage
DocLanguageTranslator [options]
Options:
-d, --docfolder <docfolder> (REQUIRED) Folder containing the documents.
-v, --verbose Show verbose messages. [default: False]
-k, --key <key> The translator Azure Cognitive Services key.
-l, --location <location> The translator Azure Cognitive Services location. [default: westeurope]
-s, --source <language> The source language of files to use for missing translations.
-c, --check Check missing files in structure only. [default: False]
--version Show version information
-?, -h, --help Show help and usage information
If the -c or --check is not provided, having a key is mandatory.
If normal return code of the tool is 0, but on error it returns 1.
Warnings, errors and verbose
If the tool encounters situations that might need some action, a warning is written to the output. The table of contents is still created.
If the tool encounters an error, an error message is written to the output. The table of contents will not be created. The tool will return errorcode 1.
If you want to trace what the tool is doing, use the -v or verbose flag to output all details of processing the files and folders and creating the table of contents.
Checking file structure integrity
If the -c or --check parameter is provided, the tool will inspect every folder with Markdown file and will check that those files are present in all the other language folder.
If there are not the exact same Markdown files (extension must be .md) an error will be raised and the missing files will be displayed in the output.
Creating the missing files for all language directories
The -k or --key parameter is mandatory for the tool to create the missing pages. Let's take the following structure example:
/userdocs
/.attachments
picture-en.jpg
picture-de.jpg
photo.pgn
otherdoc.pptx
/en
index.md
/plant-production
morefiles.md
/de
.override
index.md
one-more.md
/plant-production
morefiles.md
and-more.md
/fr
index.md
toc.yml
You will have to run the tool with a command line like: DocLanguageTranslator -d c:\path\userdocs -k abcdef0123456789abcdef0123456789
Notes:
- Your key has to be a valid key. This is an example key.
- The directory can be absolute (e.g.
c:\path\userdocs) or relative (e.g..\userdocs) and has to be the root directory where the language folders are soen,deandfrin this case (e.g. the folders will then be\usersdocs\en,userdocs\de, anduserdocs\fr, respectively).
Once you run the command, the program will look at the exiting file in each directory and will translate them and place them in the correct destination folder. So after the tool will run, you will find:
/userdocs
/.attachments
picture-en.jpg
picture-de.jpg
photo.pgn
otherdoc.pptx
/en
index.md
one-more.md
/plant-production
morefiles.md
and-more.md
/de
.override
index.md
one-more.md
/plant-production
morefiles.md
and-more.md
/fr
index.md
one-more.md
/plant-production
morefiles.md
and-more.md
index.md
toc.yml
The full file structure and all the Markdown files will be created in the fr directory and translated to French from the different sources.
The and-more.md file existing only in the de language will be translated to English and French.
Source language
In the previous example, "en" is automatically selected as the source language to translate most of the missing files, because it's the first folder, listed alphabetically, which contains the source files.
To explicitly set the source language, pass the language code to the -s or --source command line option.
In this case, only missing files which exist in the source language directory will be used for translations.
Limitations
- The translation process is not perfect! It is more than strongly encouraged to have someone speaking natively the language to help in doing the translation in a better way.
- Please check all the relative links, including the images, sometimes, they are translated while they should not be. Use the VS Code preview to make sure all images are displayed correctly.
- The translation is taking some time as it's done per paragraph and a request is done for every paragraph. This allow a smooth process and reducing the cost of a fast translation.
- Please make sure to run the linter after any translation, the translation may have created additional line ending, changed some tables, etc.
- If you hit a limit, the tool will wait and will try again.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.39.0 | 77 | 12/8/2025 |
| 1.38.0 | 108 | 11/26/2025 |
| 1.37.0 | 317 | 10/22/2025 |
| 1.36.0 | 462 | 8/11/2025 |
| 1.35.0 | 362 | 7/22/2025 |
| 1.34.0 | 435 | 7/1/2025 |
| 1.33.0 | 354 | 6/3/2025 |
| 1.32.0 | 1,388 | 12/19/2024 |
| 1.31.0 | 90 | 12/19/2024 |
| 1.30.0 | 90 | 12/18/2024 |
| 1.29.0 | 97 | 12/16/2024 |
| 1.28.0 | 375 | 11/26/2024 |
| 1.27.0 | 218 | 11/21/2024 |
| 1.24.0 | 239 | 11/14/2024 |
| 1.23.0 | 184 | 10/30/2024 |
| 1.22.0 | 133 | 10/29/2024 |
| 1.21.0 | 737 | 9/2/2024 |
| 1.20.0 | 149 | 8/21/2024 |
| 1.19.0 | 622 | 5/16/2024 |
| 1.18.0 | 522 | 1/18/2024 |
| 1.17.0 | 963 | 12/8/2023 |
| 1.16.0 | 257 | 11/15/2023 |
| 1.15.0 | 164 | 11/6/2023 |
| 1.14.0 | 152 | 11/2/2023 |
| 1.13.0 | 187 | 10/24/2023 |
| 1.12.0 | 215 | 10/11/2023 |
| 1.11.0 | 117 | 10/11/2023 |
| 1.10.0 | 2,224 | 4/5/2023 |
| 1.9.0 | 342 | 4/4/2023 |