Simple Bash script to translate the whole commit message history of a local Git repository from one language to another using DeepLX!
- Create a permanent installation location:
mkdir -p ~/Documents/Program-Files/Git-DeepL-Translator;
- Download the latest
git-deepl-translator
repo locally to the permanent installation location:cd ~/Documents/Program-Files/Git-DeepL-Translator; wget "$( curl -s -H "Accept: application/vnd.github.v3+json" \ 'https://api.github.com/repos/Rikj000/Git-DeepL-Translator/releases/latest' \ | jq .assets[0].browser_download_url | sed -e 's/^"//' -e 's/"$//')";
- Setup a system link for easy CLI usage:
sudo ln -s ~/Documents/Program-Files/Git-DeepL-Translator/git-deepl-translator.sh /usr/bin/git-deepl-translator;
Following is the output of git-deepl-translator -h
:
Git-DeepL-Translator - v1.0.0
Simple "bash" script to translate the whole commit message history,
of a local Git repository, from one language to another, using DeepLX!
Usage:
git-deepl-translator [options]
Example:
git-deepl-translator -ig="/path/to/git/input/repo" -og="/path/to/git/output/repo" -il 'FR' -ol 'EN'
Optional options:
-h, -help Show this help.
-u, -update Update Git-DeepL-Translator to the latest version.
-du, -deeplx_url=<url> URL to the DeepLX API, defaults to 'http://localhost:1188'
-ds, -deeplx_retry_seconds=<sec> Amount of seconds to wait before retrying to fetch a DeepLX translation in case none was received, defaults to 10
-ig, -input_git_repo_dir=<path> Path to local input Git repository
-og, -output_git_repo_dir=<path> Path to local output Git repository
-il, -input_language=<lang> Language used by the commit messages of the input Git repository, defaults to 'JA' (Japanese)
-ol, -output_language=<lang> Language to translate the commit messages of the output Git repository into, defaults to 'EN' (English)