Skip to content

Examples

Terminal window
# Navigate to your Flutter project
cd my_flutter_app
# Extract text and generate translation files
transflow-cli extract
# Check the output
ls transflow_output/
# Output: translations.json app_en.arb
Terminal window
# Extract from specific path with JSON output only
transflow-cli extract -p ./lib/screens -f json
# Extract and replace text in files (with backup)
transflow-cli extract -r
# List project structure first
transflow-cli list
Terminal window
# 1. Extract text from your Flutter project
transflow-cli extract -p ./my_flutter_app
# 2. Check the generated ARB file
cat transflow_output/app_en.arb
# 3. Save your API key (one-time setup)
transflow-cli set-api-key -k your-api-key-here
# 4. Translate to French (uses saved API key)
transflow-cli translate -f transflow_output/app_en.arb -t fr
# 5. Translate to Spanish (uses saved API key)
transflow-cli translate -f transflow_output/app_en.arb -t es
# 6. Use the translated files in your Flutter app
# app_fr.arb, app_es.arb are now ready for use
Terminal window
# Save your API key securely (one-time setup)
transflow-cli set-api-key -k your-api-key-here
# Use translation without specifying API key
transflow-cli translate -f app_en.arb -t fr
# Override saved key for a specific command
transflow-cli translate -f app_en.arb -t es --api-key different-key
# Test API connection
transflow-cli translate -f app_en.arb -t fr --test-api