deepldoc is a tool that automatically translates your project's documentation into another language. Written in the Go language, it uses DeepL's API as the translation engine.
You can install deepldoc and deepl using Homebrew:
brew tap koriym/deepldoc
brew install deepldoc
brew install deepl
Alternatively, if you prefer not to use Homebrew, you can download and run the binaries directly by following the steps in the How to Download and Run Binaries section below.
- After creating an account, obtain an API key.
- Set the API key as an environment variable by executing the following command in the terminal:
export DEEPL_API_KEY=your_api_key_here
- The
deepl
command is used as follows:
. /deepl text [target_language]
- text is the text to be translated.
- target_language is the language code of the target language.
To use deepldoc
, follow these instructions:
. /deepldoc source_directory [target_language] [file_extension]
- source_directory is the path to the directory containing the documents you want to translate.
- target_language is the language code of the target language (e.g. 'ja'). If omitted, 'ja' is used by default.
- file_extension is the extension of the file to be translated (e.g. 'md'). If omitted, 'md' is used by default.
-
deepldoc translates files with the relevant file extensions and copies files with non-relevant extensions as they are. This preserves the original directory structure.
-
deepldoc preserves code blocks and links in your documents. Text wrapped in triple backticks (``` and ~~~) will not be translated, ensuring accurate representation of your code samples.
Follow these steps to download and run the deepl
and deepldoc
files:
- Go to the releases page and download
deepl
anddeepldoc
.
- Open a terminal and navigate to your downloads folder:
cd ~/Downloads
- Make the files executable:
chmod +x deepl
chmod +x deepldoc
./deepl
./deepldoc
That's it!