Automatically translate comments and docstrings in a Python project, without touching regular strings.
- Docstrings & Comments: Translate
""" ... """,''' ... ''', and# ...comments into the language of your choice. - Graphical User Interface (GUI): Easily switch to GUI mode using the
Pydoc-Translatecommand. - Command-Line Interface (CLI): Automate translation using the
Pydoc-Translate-CLIcommand, perfect for integration into other scripts. - Output Folder: Translated files are stored in an
outputfolder, created automatically. - Cyberpunk Style: Minimalistic, dark-themed interface for an immersive experience.
- pypi https://pypi.org/project/pydoc-translate/
pip install pydoc-translate
- Clone this repository:
git clone https://github.com/Taks-69/PyDoc-Translate
- Navigate to the project directory:
cd PyDoc-Translate - Install the module (build the distributions, then install them):
python setup.py sdist bdist_wheel pip install dist\pydoc_translate-1.0.2-py3-none-any.whl
- Navigate to the directory where you want the
outputfolder to be created. - Launch the GUI:
Pydoc-Translate
- Select a
.pyfile or a folder containing.pyfiles. - Enter the target language (e.g.,
en,fr,es, etc.). - Click "Start Translation".
- Translated files will appear in the
outputfolder at the same location where the command was run.
-
Run the following command:
Pydoc-Translate-CLI --path="my_file.py" --lang=es --output="output_es"
--path: Path to a.pyfile or a folder containing.pyfiles.--lang: Target language (default:en).--output: Name of the output folder (default:output).
-
Translated files will be saved in the specified folder (
output_esin the example).
""" Hello everyone, test 01 Display hello """
print("hello")
""" Another docstring """
# Hello everyone, test 02 Display hello
" Simple string, not translated """" Bonjour tout le monde, test 01 Afficher bonjour """
print("hello")
""" Un autre docstring """
# Bonjour tout le monde, test 02 Afficher bonjour
" Simple string, not translated "For educational use only. Any misuse or inappropriate use of this program is solely the responsibility of the user.
- Python 3
- Googletrans (Unofficial API)
- Tkinter for the GUI (included in most Python distributions)
- argparse for the CLI
This project is licensed under the GNU General Public License v3.0.
⭐ Feel free to leave a star if you find this project useful!