Skip to main content

Google Translate Integration Guide

Overview

The Google Translate integration allows your NINA workflows to connect with Google Cloud Translation API for automated text translation services. This integration enables you to translate text between different languages, detect source languages automatically, and access Google's comprehensive language support directly from your workflows.

Status

At present, our integration comprehensively supports key translation functionalities, including:

  • Text Translation: Translate text from one language to another
  • Language Detection: Automatically detect the source language of text
  • Language Selection: Choose target and source languages from a comprehensive list
  • Dynamic Language Retrieval: Access real-time list of supported languages from Google Translate

The integration provides a streamlined approach to multilingual content processing within your automation workflows.

Credential Configuration

Before using the Google Translate integration in your workflows, you need to configure credentials for authentication. The NINA platform supports three authentication methods for Google Translate:

Authentication Methods

1. API Key Authentication

The simplest method is to use a Google Translate API key:

FieldDescriptionExample
API KeyGoogle Translate API key for authenticationAIzaSyC4E1Pz...
Auth TypeAuthentication typeapiKey

How to get your API Key:

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Cloud Translation API for your project
  4. Navigate to "APIs & Services" > "Credentials"
  5. Click "Create Credentials" and select "API Key"
  6. Copy the generated API key
  7. (Optional) Restrict the API key to specific APIs and IP addresses for security

2. OAuth2 Authentication

For more advanced scenarios or when you need enhanced security:

FieldDescriptionExample
Client IDOAuth2 client ID1234567890-abc123def456.apps.googleusercontent.com
Client SecretOAuth2 client secretGOCSPX-abc123def456ghi789jkl
ScopeOAuth2 scope for Google Cloud Translationhttps://www.googleapis.com/auth/cloud-translation
Auth URLAuthorization URLhttps://accounts.google.com/o/oauth2/v2/auth
Access Token URLAccess Token URLhttps://oauth2.googleapis.com/token
Auth TypeAuthentication typeoauth2

How to set up OAuth2:

  1. Go to the Google Cloud Console
  2. Navigate to "APIs & Services" > "Credentials"
  3. Click "Create Credentials" and select "OAuth 2.0 Client IDs"
  4. Configure the OAuth consent screen if prompted
  5. Choose "Web application" as the application type
  6. Add authorized redirect URIs:
    • For POC environment: https://poc.zynap.com/api/v1/oauth2/callback
    • For Production environment: https://platform.zynap.com/api/v1/oauth2/callback
  7. Note your Client ID and Client Secret

3. Service Account Authentication

For server-to-server authentication in production environments:

FieldDescriptionExample
EmailService account email address[email protected]
Private KeyService account private key-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAo...
Auth TypeAuthentication typeserviceAccount

How to set up Service Account:

  1. Go to the Google Cloud Console
  2. Navigate to "IAM & Admin" > "Service Accounts"
  3. Click "Create Service Account"
  4. Provide a name and description for the service account
  5. Grant the "Cloud Translation API User" role
  6. Create and download a JSON key file
  7. Extract the email and private_key fields from the JSON

Creating a Google Translate Credential

  1. Navigate to the Credentials section in NINA

  2. Click Add New Credential

  3. Fill in the credential details:

    • Name: A descriptive name (e.g., "Google Translate Production")
    • Description: Optional details about the credential's purpose
    • Integration Service: Select "Google Translate"
    • Auth Type: Choose "apiKey", "oauth2", or "serviceAccount"
    • Fill in the authentication fields based on your selected auth type
  4. Click Test Connection to verify credentials

  5. Click Save to store the credential

Supported Resources and Operations

The Google Translate integration supports the following resources and operations:

Language

OperationDescription
TranslateTranslates text from one language to another

Parameter Merging

The Google Translate integration takes full advantage of NINA's parameter merging capabilities:

Parameter Sources (in order of precedence)

  1. Node Parameters: Parameters configured directly in the Google Translate Integration Node
  2. Extracted Parameters: Parameters automatically extracted from the input data
  3. Input Data: The complete input data from upstream nodes

When a Google Translate Integration Node executes:

  • It combines parameters from all sources
  • Node parameters take precedence over extracted parameters
  • The combined parameters are used to execute the Google Translate operation

Dynamic Language Selection

The integration provides dynamic language selection through the getLanguages method, which retrieves the current list of supported languages from Google Translate. This ensures you always have access to the most up-to-date language options.

Language Selection Modes

1. List Mode (Dropdown Selection)

Select from a searchable dropdown of available languages:

  • Real-time language list from Google Translate
  • Searchable interface for quick language selection
  • Display names in human-readable format

2. ID Mode (Language Code Input)

Enter language codes directly:

  • Use standard language codes (e.g., 'en', 'es', 'fr', 'de')
  • Suitable for automated workflows with known language codes
  • Supports all ISO 639-1 language codes

Examples

Basic Text Translation

Below is an example of translating text from one language to another:

Node Configuration:

{
"resource": "language",
"operation": "translate",
"parameters": {
"text": "Hello, how are you today?",
"translateTo": {
"mode": "list",
"value": "Spanish"
},
"additionalFields": {
"detectSourceLanguage": true
}
}
}

Translation with Specific Source Language

When you know the source language and want to specify it explicitly:

Node Configuration:

{
"resource": "language",
"operation": "translate",
"parameters": {
"text": "Bonjour, comment allez-vous aujourd'hui?",
"translateTo": {
"mode": "id",
"value": "en"
},
"additionalFields": {
"detectSourceLanguage": false,
"sourceLanguage": {
"mode": "id",
"value": "fr"
}
}
}
}

Use Cases

Customer Support Automation

Automatically translate customer inquiries to your support team's language:

{
"resource": "language",
"operation": "translate",
"parameters": {
"text": "Hola, necesito ayuda con mi pedido",
"translateTo": {
"mode": "id",
"value": "en"
},
"additionalFields": {
"detectSourceLanguage": true
}
}
}

Content Localization

Translate marketing content for different regions:

{
"resource": "language",
"operation": "translate",
"parameters": {
"text": "New Product Launch - Experience the latest innovation in mobile technology",
"translateTo": {
"mode": "list",
"value": "Spanish"
},
"additionalFields": {
"detectSourceLanguage": false,
"sourceLanguage": {
"mode": "id",
"value": "en"
}
}
}
}

Multilingual Documentation

Translate documentation and help articles:

{
"resource": "language",
"operation": "translate",
"parameters": {
"text": "To reset your password, click on the 'Forgot Password' link on the login page and follow the instructions sent to your email.",
"translateTo": {
"mode": "id",
"value": "fr"
},
"additionalFields": {
"detectSourceLanguage": true
}
}
}

Best Practices

Performance Optimization

  1. Batch Processing: Group multiple translation requests when possible
  2. Language Detection: Use automatic language detection for unknown source languages
  3. Caching: Consider caching frequently translated content
  4. Rate Limiting: Be mindful of API rate limits in high-volume scenarios

Quality Considerations

  1. Context Awareness: Provide sufficient context for accurate translations
  2. Terminology: Consider using custom translation models for domain-specific content
  3. Review Process: Implement human review for critical translations
  4. Format Preservation: Be aware that formatting may be affected during translation

Security and Compliance

  1. Data Privacy: Ensure sensitive data is handled according to your privacy requirements
  2. API Key Security: Store API keys securely and rotate them regularly
  3. Content Filtering: Implement content filtering for inappropriate material
  4. Audit Logging: Log translation activities for compliance purposes

Troubleshooting

Common Issues

Authentication Errors

  • Verify your API key or credentials are correct
  • Check that the Cloud Translation API is enabled in your Google Cloud project
  • Ensure your service account has the proper roles assigned

Translation Quality Issues

  • Provide more context in the source text
  • Consider specifying the source language explicitly
  • Review Google's translation quality guidelines

Rate Limit Exceeded

  • Implement proper rate limiting in your workflows
  • Consider upgrading your Google Cloud Translation quota
  • Use batch processing for multiple translations

Language Code Errors

  • Verify language codes are valid ISO 639-1 codes
  • Use the dynamic language list to see all supported languages
  • Check for typos in manually entered language codes

Error Handling

Implement proper error handling in your workflows:

{
"error_handling": {
"on_authentication_error": "retry_with_backoff",
"on_rate_limit": "wait_and_retry",
"on_invalid_language": "log_and_skip",
"on_translation_error": "fallback_to_original"
}
}

Additional Resources

For additional support or questions about the Google Translate integration, consult the NINA documentation or contact your system administrator.