generate_translator 1.0.3 copy "generate_translator: ^1.0.3" to clipboard
generate_translator: ^1.0.3 copied to clipboard

A CLI tool to convert plain text files into translated JSON files using Google Translate.

🧩 Generate Translator #

Generate Translator is a command-line tool (CLI) that converts plain .text files into JSON or ARB multilingual files using Google Translate API.


🚀 Installation #

Install globally via pub.dev:

dart pub global activate generate_translator

🛠️ Usage #

  1. Translate a single language:
generate_translator vi ./assets/input.text ./assets/vi.json
  1. Translate multiple languages using a shell script:
items=("vi" "en" "zh-tw" "zh-cn")

for item in "${items[@]}"
do
  generate_translator $item ../assets/input.text ./$item.arb
done

📁 The input.text file should contain the strings to translate, one per line.

🍎 IOS / macOS / Linux Setup #

✅ Make sure the terminal can find generate_translator globally: Add the following line to your ~/.zshrc, ~/.bashrc, or ~/.bash_profile:

export PATH="$PATH":"$HOME/.pub-cache/bin"

Then reload your terminal config:

source ~/.zshrc   # or ~/.bashrc depending on your shell

Sample input.text #

Hello
Welcome
Logout

After running the script, it will generate translated files like vi.json, en.json, zh-tw.arb, etc.

2
likes
0
points
130
downloads

Publisher

unverified uploader

Weekly Downloads

A CLI tool to convert plain text files into translated JSON files using Google Translate.

License

unknown (license)

Dependencies

http

More

Packages that depend on generate_translator