transly-cli
v1.0.2
Published
A CLI tool for translating files using Google Translate.
Maintainers
Readme
Transly CLI Tool
Transly is a command-line tool designed to translate files in different formats (JSON, CSV, TXT) using Google Translate. It aims to provide developers and users with an easy way to translate data efficiently, with caching support to avoid repeated translations of the same text.
Features
- Supports multiple file formats: JSON, CSV, TXT.
- Caches translations to prevent re-translation of the same content, improving speed.
- Allows users to select both source and target languages.
- Displays translation progress with a progress bar.
Requirements
- Node.js version >= 14.0.0
- Internet connection (for making translation requests)
Installation
To install Transly globally using NPM:
npm install -g transly-cliUsage
Once installed, you can start using Transly through the command line.
Start Transly
To display the logo and available options, use the following command:
transly startThis will display the Transly logo along with helpful information about how to use the tool.
Translating Files
Transly allows you to translate JSON, CSV, and TXT files to your target language.
Translating a JSON File
transly translate <file_path> -l <target_language>Example:
transly translate test.json -l faThis will translate the contents of test.json to Farsi.
Translating a CSV File
transly translate <file_path> -l <target_language>Example:
transly translate test.csv -l esThis will translate the contents of test.csv to Spanish.
Translating a TXT File
transly translate <file_path> -l <target_language>Example:
transly translate test.txt -l deThis will translate the contents of test.txt to German.
Additional Options
-s, --source <source>: Specify the source language for translation (default isenfor English).
Example:
transly translate test.json -l fa -s enThis command will translate test.json from English to Farsi.
Example Files for Testing
You can create the following sample files to test the tool:
JSON Example File (test.json)
{
"greeting": "Hello",
"farewell": "Goodbye",
"question": "How are you?",
"statement": "This is a test."
}CSV Example File (test.csv)
message
Hello
Goodbye
How are you?
This is a test.TXT Example File (test.txt)
Hello
Goodbye
How are you?
This is a test.Extended Example Files
These files contain 50 entries each for more extensive testing:
long_test.json: Contains 50 key-value pairs.long_test.csv: Contains 50 rows of data.long_test.txt: Contains 50 lines of text.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for more details.
NPM Package
Website and Social Media
- Website: sirvav.com
- Instagram: sirvav_com
Future Plans
- Web Version: Plan to create a web version for online use with subscription-based advanced features.
- API Integration: Allow integration with other services using an API.
Published on NPM
Transly is now available on NPM for installation and use globally.
For any questions or feedback, feel free to reach out or open an issue on the GitHub repository!
Happy translating! 🚀
