desktoptranslator
Local cross-platform machine translation GUI, based on CTranslate2
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.4%) to scientific vocabulary
Keywords
Repository
Local cross-platform machine translation GUI, based on CTranslate2
Basic Info
Statistics
- Stars: 92
- Watchers: 4
- Forks: 6
- Open Issues: 3
- Releases: 3
Topics
Metadata Files
README.md
DesktopTranslator
Local cross-platform machine translation GUI, based on CTranslate2

Table of contents
Download DesktopTranslator

Translation Models
Currently, DesktopTranslator supports CTranslate2 models, and SentencePiece subwording models (you need both). If you have a model for OpenNMT-py, OpenNMT-tf, or FairSeq, you can convert it to the CTranslate2 format.
French-to-English Generic Model
If you would like to try out the app and you do not have a model, you can download my French-to-English generic model here.
1. Unzip the fren.zip archive of the French-to-English generic model you just downloaded. It has two folders, ct2_model for the CTranslate2 model and sp_model for the SentencePiece subwording models of French (source) and English (target).
2. In DesktopTranslator, click the CTranslate2 Model button, and select the ct2_model folder.
3. Click the SentencePiece Model button, navigate to the sp_model folder, and select fr.model.
4. The default Beam Size is 3. You can increase it to 5, which can be slower, but sometimes results in better translation quality.
5. In the left input text-area, type some text in French or use the File menu > Open... to open a *.txt file.
6. Click the Translate button.
M2M-100 Multilingual Model
Now, DesktopTranslator supports M2M-100 (Fan et al., 2020), a multilingual model that can translate between 100 languages.

To use M2M-100 models in DesktopTranslator, please follow these steps:
1. Download one of the M2M-100 models, converted to the CTranslate2 format:
a. M2M-100 418M-parameter model; smaller and faster, but sometimes less accurate; or
b. M2M-100 1.2B-parameter model; bigger and somehow slower, but sometimes more accurate.
2. Extract the .zip arhieve of the model you downloaded.
3. In DesktopTranslator, click the CTranslate2 Model button, and select the m2m100_418m or m2m100_12b folder.
4. Click the SentencePiece Model button, and from the same model folder, select sentencepiece.model.
5. *Important:** From the M2M-100 dropdown list, select the target language to which you want to translate. This step is different between M2M-100 and some other models. M2M-100 models require a language code prefix. For other models that do not require this, keep the "None" option.
6. The default Beam Size is 3. You can increase it to 5, which can be slower, but sometimes results in better translation quality.
7. In the left input text-area, type some text in any language or your choice of use the File menu > Open... to open a *.txt file.
8. Click the Translate button.
OPUS Models
OPUS models (Tatoeba-Challenge) can be used and they can be more efficient. As of now, only bilingual models are supported by DesktopTranslator. Note: You must convert an OPUS model to the CTranslate2 format first. Example command:
ct2-opus-mt-converter --model_dir opus_model_dir --output_dir ct2_model_dir --quantization int8
The source and target tokenization SentencePiece models can be found in the same archive of the downloaded model.
[Optional] Build Stand-alone Executable
Build Windows Installer
If you want to adjust the code and then build an installer yourself, you can follow these steps:
Install PyInstaller:
pip3 install pyinstallerTo use PyInstaller, specify the Python file name and the argument -w to hide the console window:
pyinstaller -y -w "translator.py"If you would like to add an extra folder, e.g. "utils", the command will be:pyinstaller -y -w --add-data="utils/*;utils/" "translator.py"Try the
*.exefile under "dist\translator" to make sure it works. It might complain about the Pmw library. The solution is either remove the Balloon lines, or add this file to the same folder as thetranslate.pyand run the aforementioned PyInstaller command again.Compress the contents of the “dist” directory created by PyInstaller into a *.zip archive. For example, you can find a folder called "translator"; give it the name you like, e.g. "DesktopTranslator", and add it to a *.zip archive.
Download and install NSIS.
Launch NSIS, click Installer based on a .ZIP file, and then click Open to locate the *.zip archive you have just created.
If you want to make the files installed (extracted) to the “Program Files” of the target user, in the Default Folder enter
$PROGRAMFILESIf you want to add a shortcut to the internal *.exe file on the Desktop after installation, you can add something like this to the file “Modern.nsh” located at: "C:\Program Files\NSIS\Contrib\zip2exe\". Depending on your OS, the path could be at “Program Files (x86)”. Note that the EXE file path should be consistent with the path you selected under NSIS’s “Default Folder” drop-down menu, the folder name, and the EXE file name.
Section "Desktop Shortcut" SectionX SetShellVarContext current CreateShortCut "$DESKTOP\DesktopTranslator.lnk" "$PROGRAMFILES\DesktopTranslator\translator.exe" SectionEndIf you get a permission error while trying to save the edited version of “Modern.nsh”, right-click your text editor (e.g. Notepad), and select "Run as administrator". Then, copy the contents of the file into a new file, and save it to the original location.Finally, click the NSIS Generate button, which will create the **.exe* installer that can be shipped to other Windows machines, without the need to install any extra requirements.
After installation, if you applied step #8, you should find an icon on the Desktop. To uninstall, you can simply remove the app folder from "Program Files". For more NSIS options, check this example.
Build macOS App
- Install
py2apppip3 install py2app==0.25 - Create a setup.py file in the same directory.
- Run this command in the Terminal. You can add the option
-Ato test the app first.python3 setup.py py2app
References
Owner
- Name: Yasmin Moslem
- Login: ymoslem
- Kind: user
- Location: Dublin, Ireland
- Company: ADAPT Centre, Dublin City University
- Website: https://machinetranslation.io/
- Repositories: 4
- Profile: https://github.com/ymoslem
Machine Translation Researcher
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: DesktopTranslator
message: 'If you use this app, please cite this'
type: software
authors:
- given-names: Yasmin
family-names: Moslem
email: yasmin@machinetranslation.io
affiliation: MachineTranslation.io
identifiers:
- type: url
value: 'https://github.com/ymoslem/DesktopTranslator'
repository-code: 'https://github.com/ymoslem/DesktopTranslator'
url: 'https://www.machinetranslation.io/'
GitHub Events
Total
- Issues event: 2
- Watch event: 9
- Issue comment event: 2
- Fork event: 1
Last Year
- Issues event: 2
- Watch event: 9
- Issue comment event: 2
- Fork event: 1
Packages
- Total packages: 2
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 8
proxy.golang.org: github.com/ymoslem/desktoptranslator
- Documentation: https://pkg.go.dev/github.com/ymoslem/desktoptranslator#section-documentation
- License: mit
-
Latest release: v0.3.0
published about 4 years ago
Rankings
proxy.golang.org: github.com/ymoslem/DesktopTranslator
- Documentation: https://pkg.go.dev/github.com/ymoslem/DesktopTranslator#section-documentation
- License: mit
-
Latest release: v0.3.0
published about 4 years ago
Rankings
Dependencies
- Pmw ==2.0.1
- charset-normalizer ==2.0.11
- ctranslate2 ==2.12.0
- fasttext ==0.9.2
- indic-nlp-library ==0.81
- numpy ==1.21.5
- pysbd ==0.3.4
- sentence-splitter ==1.4
- sentencepiece ==0.1.96
- tqdm ==4.62.3