AutoTranslate is a Python script designed to automatically translate text files. It uses the Google Translate API to perform translations between multiple languages, facilitating content localization for different users.
- Bulk text translation from text files.
- Support for multiple languages via Google Translate.
- Automatically ignore non-translatable content (identifiers, media files, etc.).
- Display progress status for the translation process.
- Handle special sequences to preserve formatting.
You can clone this repository and install the necessary dependencies:
git clone https://github.com/Felzow47/Autotranslate.git
cd Autotranslate
pip install deep_translator
directory = 'path/to/folder'
To customize the translation language, modify the values of the source_lang
and target_lang
parameters in the translate_text_in_code
function according to your needs.
To know the languages supported by the Google API, consult the list of available languages.
Here's how to define the source and target languages in the code:
def translate_text_in_code(file_path, source_lang='en', target_lang='fr'):
To translate Ren'Py games using .rpy
files, simply modify the extension searched for in the script. For example, replace the following line:
if filename.endswith('.rpy'):
Feel free to fork the project and contribute as you wish! Your ideas and improvements are welcome.
This project is under free license, so feel free to use it