Package: md_translate
Markdown Docs TranslatorMarkdown Docs Translator is an automated translator for Markdown documents, built with Python. The tool supports multiple translation services and provides a variety of options to customize the translation process.FeaturesSupport for multiple translation services (Yandex, Google, Bing, Deepl).Multithreading for faster translations.Options to overwrite original files, drop original files, or create a new file with translated text.Continuing translation in case of an error or interruption.Caching for faster repeat translations.Verbosity level control.InstallationNote:Chrome browser is required to be installed on your system.From PyPI (highly recommended to use pipx):pipxinstallmd-translateGit:gitclonehttps://github.com/ilyachch/md_docs-trans-app.gitcdmd_docs-trans-app
pipinstall.UsageExample:md-translatepath_to_file_or_folder-Fsource_lang-Ttarget_lang-Pservice[OPTIONS]Where:path_to_file_or_folderis the path to the markdown file or folder containing markdown files to translate.source_langis the language code of the source document.target_langis the language code for the translation.serviceis the translating service to use (yandex, google, bing, deepl).OPTIONSare additional options that can be specified as listed below.OptionsOptionDescription-F, --from-lang TEXTSource language code [required]-T, --to-lang TEXTTarget language code [required]-P, --serviceTranslating service [required]-X, --processes INTEGERNumber of processes to use. Each file is translated in separate process.-N, --new-fileCreate a new file with translated text (original file will remain unchanged). The new file will be created in the same directory as the original file with a "_translated" suffix-I, --ignore-cacheIgnore cache files. If cache exists, it will be overwritten-S, --save-temp-on-completeSave cache files upon completion. If not set, they will be deleted-O, --overwriteAlready translated files will be overwritten. Otherwise, these files will be skipped-D, --drop-originalRemove original lines from translated file. These lines will be replaced with translated ones. Otherwise translated lines will be appended after originals--deepl-api-keyDeepl API key. Required bydeepl_apitranslation provider.-v, --verboseVerbosity level--helpShow help message and exitCurrently supported services are:YandexGoogleBingDeeplLibreTranslateDeepL APIConfiguring with a Configuration FileOptions for the application can be defined through a configuration file as well. This file should be namedsettings.jsonand is typically located at~/.config/md_translate.If you choose to use a non-default location for the config file, you can specify its path using the--configor-Coption.This configuration file can encompass all CLI options exceptpath,from_lang,to_lang,serviceandconfig_file_path. These particular options need to be stated directly in the CLI.The configuration file should be a valid JSON file and adhere to the following structure:{"processes":4,"new_file":true,"ignore_cache":false,"save_temp_on_complete":false,"overwrite":false,"verbose":1,"drop_original":false}ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT