Skip to content

Felzow47/AutoTranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

AutoTranslate

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.

Table of Contents

Features

  • 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.

Installation

You can clone this repository and install the necessary dependencies:

git clone https://github.com/Felzow47/Autotranslate.git
cd Autotranslate
pip install deep_translator

Usage

Make sure to include the directory containing the files to be translated:

directory = 'path/to/folder'

Changing the Source and Target Languages

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.

Available Languages

To know the languages supported by the Google API, consult the list of available languages.

Function Example

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'):

Examples

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'):

Contributions

Feel free to fork the project and contribute as you wish! Your ideas and improvements are welcome.

License

This project is under free license, so feel free to use it

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages