Skip to content

`textfile_translate` is a text file translation program. It uses google translator service as a backend.

Notifications You must be signed in to change notification settings

alisio/textfile_translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

textfile_translate is a text file translation program. It uses google translator service as a backend.

Install:

Put the script in the path, install the required python modules and you're good to go:

pip install -r requirements.txt

Usage

Run:

textfile_translate.py [-l <LANGUAGE_CODE>] -i <SRC>

Options:

-l    Optional. iso639-1 destination language code. Default: pt
-s    Optional. Text block size in characters to be translated. This option is due to google api limitations. Default: 5000
-i    Mandatory. Path to source file, aka, the file to be translated.

Output:

A new file containing the translated text will be created on the same as the original text file. The destination language code will be appended to the end of the new filename, before the extension.

Example:

  • Input file: article.txt
  • Output article.pt.txt

Limitations

All Google Translate service limitations are applied. Tested using MacOS Monterey running python 3.9

There's no error catching whatsoever. You are welcome to implement it yourself.

References:

Author

Antonio Alisio de Meneses Cordeiro - [email protected]

About

`textfile_translate` is a text file translation program. It uses google translator service as a backend.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages