Translate Python comments and docstrings into any language.
Project description
PyDoc Translate
Automatically translate comments and docstrings in a Python project, without touching regular strings.
Features
- 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.
Installation
- 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.0-py3-none-any.whl
Usage (GUI)
- 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.
Usage (CLI)
-
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).
Example Input File
""" Hello everyone, test 01 Display hello """
print("hello")
""" Another docstring """
# Hello everyone, test 02 Display hello
" Simple string, not translated "
Output Example (e.g., in fr)
""" 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 "
Disclaimer
For educational use only. Any misuse or inappropriate use of this program is solely the responsibility of the user.
Technologies Used
- Python 3
- Googletrans (Unofficial API)
- Tkinter for the GUI (included in most Python distributions)
- argparse for the CLI
License
This project is licensed under the GNU General Public License v3.0.
⭐ Feel free to leave a star if you find this project useful!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydoc-translate-1.0.1.tar.gz.
File metadata
- Download URL: pydoc-translate-1.0.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82691e8e47f629d489cfa0ddf5e927f49f22115991876d0931080b4fabf52c7e
|
|
| MD5 |
cd8a75bbddc31704396f5465f19149a6
|
|
| BLAKE2b-256 |
0d4de9df9ed23e086453e51bea932ee07ee9504333ac99e5a5aa350edf21092f
|
File details
Details for the file pydoc_translate-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pydoc_translate-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af8327917660f3c9de45554c715564ffd51e0cc1fcc1a5c67a6cbfb5af40dffc
|
|
| MD5 |
a935a88f98e89094b4a0397e7ccc69f4
|
|
| BLAKE2b-256 |
9345d6e32c2ddb6eb423c91b1cc197f4e08b23dfe6ff355e77697c16b0dbb886
|