DesktopTranslator, a Local Translation App for Windows and macOS

18 Jan 2020 » nmt

DesktopTranslator is a free desktop application that translates text and text files on your own computer. It uses CTranslate2 for fast translation and SentencePiece for subwording, so once you have a model, you do not need an Internet connection. This post shows how to install it, how to use it with different translation models, and how to build your own installer.

DesktopTranslator on macOS, translating French text into English with the M2M-100 language list open

  • The source language is detected, and each sentence is translated on its own, keeping your paragraphs
  • The translation appears as it is made, and you can cancel and keep what is done
  • Long files are translated in the background with File menu > Translate Document…
  • Right-to-left languages such as Arabic are edited right to left, and the app follows the dark mode of your system
  • Installers for Windows and macOS, or run it from source

The code is open source under the MIT license.

Download

Translation Models

DesktopTranslator needs two things, a CTranslate2 model and a SentencePiece subwording model. If you have a model for OpenNMT-py, OpenNMT-tf, or FairSeq, you can convert it to the CTranslate2 format.

To translate with a bilingual model, follow these steps.

  1. In DesktopTranslator, click the Open Model button and select the folder of the converted model. The SentencePiece model of the source language is expected to be in the same folder as the model itself.
  2. In the left text area, type some text, or use the File menu and then Open... to open a .txt file.
  3. Click the Translate button.

NLLP-200 Multilingual Models

DesktopTranslator also supports NLLB-200 of different sizes (600M, 1.3B, and 3.3B), which allows translation between 200 languages.

M2M-100 Multilingual Models

DesktopTranslator also supports M2M-100, a multilingual model that translates between 100 languages. Select the CTranslate2 model folder and the sentencepiece.model file of the M2M-100 model as above. Then choose the target language from the dropdown list. This step is specific to M2M-100, because it needs a language code prefix. For other models, keep the “None” option.

OPUS Models

Bilingual OPUS models can also be used, and they can be more efficient. Convert the model to the CTranslate2 format first, for example.

ct2-opus-mt-converter --model_dir opus_model_dir --output_dir ct2_model_dir --quantization int8

The source and target SentencePiece models are in the same archive as the downloaded OPUS model.

See Also

References