Skip to content

A simple script to automatically translate data files into multiple languages

License

Notifications You must be signed in to change notification settings

mminer237/auto-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-translate

A simple PHP script to automatically translate data files into multiple languages using free DeepL or Google Translate APIs

Supported Data

Supports translating .yaml and .json files, as well as any plain text files.

API Keys

Supports using either DeepL or Google Translate basic translation, although it prefers DeepL if available.

To get a free API key:

This counts characters and should avoid exceeding the free limits, but this is not guaranteed and a bug could cause you to exceed Google's free limit.

It can be easily modified to use DeepL's paid plan.

Usage

Usage:
	script.php <input-file|input-dir> <output-dir> <languages>
	script.php -h
	script.php [-r] -i <input-file|input-dir> -o <output-dir> -l <languages> [-t <output-file-type>]
	script.php -k <language-key> [-r] -i <input-file|input-dir> [-o <output-file>] -l <languages>

	-h                       	Show this help
	-i <input-file|input-dir>	Specify input file
	-k                       	Translate inside file based on specified language code keys
	-l <languages>           	Specify output languages
	-o <output-dir>          	Specify output directory
	-r                       	Recursively translate directory
	-t <output-file-type>    	Specify output file type

Copyright

Copyright © 2021 Matthew Miner

Released under the MIT License

About

A simple script to automatically translate data files into multiple languages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages