#!/bin/bash

GCLOUD=~/google-cloud-sdk/bin/gcloud
PROJECT=indexation-358907

echo "=== Test 1: gcloud translate (command line) ==="
$GCLOUD beta ml translate --source-language=en --target-language=fr --text="Good morning" --project=$PROJECT 2>&1 | head -20

echo ""
echo "=== Test 2: Check available gcloud translate commands ==="
$GCLOUD translate --help 2>&1 | head -30

echo ""
echo "=== Test 3: Direct REST call via gcloud with auth header ==="
TOKEN=$($GCLOUD auth application-default print-access-token 2>/dev/null)
echo "Token obtained: ${TOKEN:0:50}..."
