Get a Google Cloud Translation Basic key

Pro1 min read

All guides

Google Cloud Translation Basic is the simplest Google service to set up: one API key. It translates almost every language and costs about USD 20 per million characters. Google gives a monthly free allowance, roughly the first 500,000 characters.

Before you start

  • A Google account.
  • A credit or debit card. Google needs a billing account even for the free allowance.

Get the key

  1. Open Google Cloud Console and sign in.
  2. Create a project, for example “Lango7”, or pick an existing one.
  3. Go to Billing and link a billing account to the project.
  4. Go to APIs & Services → Library, search for Cloud Translation API and click Enable.
  5. Go to APIs & Services → Credentials, click Create credentials → API key.
  6. Copy the key. It starts with AIza.

Keep the key safe

Click the key’s name, and under API restrictions choose Restrict key and tick only Cloud Translation API. If the key leaks, it can’t be used for anything else.

Add it to Lango7

  1. Go to Translate → Settings → Translation engine.
  2. Paste the key into the Google Cloud Translation Basic box.
  3. Click Test and save. Lango7 sends a short test sentence and saves the key only if it works.

Keys are stored encrypted. If you’d rather keep the key out of the database, add define( 'LANGO7_GOOGLE_KEY', '…' ); to wp-config.php instead.

Want more natural wording? See Google Cloud Translation Advanced.