How to translate diagrams created with Diagrams.net

Donna entusiasta diagrams

This article explains the procedure for translating the textual content of a diagram created with Diagrams.net.

Diagrams.net is an online solution for creating diagrams. Formerly called draw.io, Diagrams.net is a free and open source alternative to Microsoft Visio, Lucidchart or SmartDraw.

Flowcharts, mind maps, hierarchical schemes, websites prototypes: with Diagrams.net you can easily draw many diagram types directly from your browser, no need to install additional programs.

Diagrams.net diagram examples

The diagrams created can be saved offline (in a variety of formats) or in the cloud, thanks to integration with Dropbox, OneDrive, Google Drive, Gitlab, etc.

Diagrams translation

The example below shows a diagram (available as a free template in Diagrams.net) with ten icons and the corresponding labels (in English).

Diagram in Diagrams.net

The most immediate way to translate them would be to share the diagram with a translator. However, this forces the translator to work within Diagrams.net, without a spell checker or a glossary, and with no possibility of reusing existing translations.

On the other hand, how do you share a diagram with a translator?

Diagrams.net allows diagrams to be exported in several formats: PDF, PNG, SVG, XML, and VSDX, among others.

To translate a diagram, there are two useful options: save the file as XML or as VSDX.

Warning! with Diagrams.net you can also save your file as an SVG. However, when opening a diagram exported as an SVG image in the browser, in some SVG editors or in a translation program, the text may not be displayed correctly. This is due to the fact that the SVG format generated by Diagrams.net is not designed to be editable. For more details and technical explanation, read “Why text in exported SVG images may not display correctly” in the Diagrams.net FAQ.

Translating a diagram saved as XML

In order to translate the labels in the example shown, the first step is to export the file in XML format:

Diagrams.net XML export screen

Warning! Uncheck the “Compressed” box so that the text contained in the exported XML file will be editable.

This results in a file called Test diagram.drawio.xml. This file (which is plain text and follows the syntax of XML) can be opened with any advanced text editor, such as Notepad++. You will see something similar to the following screen:

Screenshot of an XML file in Notepad++

As you can see, the text portions that can be edited are contained as values of the value attribute within the mxCell element.

Text portions may also contain HTML code and CSS fragments, making it difficult to identify what needs to be translated and the subsequent translation.

Almost all CAT tools allow you to open XML files and define the elements that need to be translated. An example of this procedure can be found in the article “Translating XML files painlessly” on this very same blog.

Translating a diagram saved as VSDX

Fortunately, Diagrams.net also allows diagrams to be exported into Microsoft Visio format (VSDX).

Once you have exported the file as VSDX, just open it in any translation program. The translation program will take care of isolating translatable texts and display them in the editor, as in the image below (example taken from OmegaT, the free and open source CAT tool we have already written about in this blog).

After that, you can create the translated file in the translation program and import it into a new Diagrams.net project.

The translation process in short

In summary, the steps required to translate a diagram created with Diagrams.net are:

  1. Export the diagram as a VSDX file, once you have created it
  2. Open the VSDX file in a CAT tool
  3. Translate texts in the CAT tool
  4. Create the translated VSDX file
  5. Import the VSDX file as a new diagram in Diagrams.net

Once the translation process is completed, it is important to make sure the diagram format is correct. Due to the difference in text length across languages and also because of technical reasons (the export and subsequent import process), the diagram may need some retouching.

Back to our example, here is what the diagram translated into Italian looks like:

Visio file imported back into Diagrams.net

You can see that the text is overlapping the icons. It will therefore have to be moved by changing the corresponding values in Diagrams.net interface.

Some translated diagrams may require much greater adjustments. We recommend you to take this review time into account in your project planning.

In case any of the above steps are not entirely clear, please post your question in the Comments section.

Support for diagrams translation created in Diagrams.net is one of the services we offer at Qabiria. Contact us if you need help.

Technical translator, project manager, entrepreneur. Languages graduate with an MA in Design and Multimedia Production. He founded Qabiria in 2008.

Further Reading

Chat to one of us

Let us know what you need by sending an email to hola@qabiria.com or by filling in the contact form. We guarantee a response within 24 hours, but usually we’re much faster.

Contact us