Skip to content

Configuration

This guide covers all configuration options for the TMGMT Lara Translate provider.

Basic Configuration

API Credentials

The module uses Drupal's Key module for secure credential storage.

Required Credentials

  1. Lara Access Key ID: Your Lara API access key identifier
  2. Lara Access Key Secret: Your Lara API secret key

Storing Credentials

  1. Go to Configuration → System → Keys (/admin/config/system/keys)
  2. Create two keys with type "API Key"
  3. In translator configuration, select these keys instead of pasting credentials directly

Provider Settings

Basic Settings

  • Label: Human-readable name for your translator instance
  • Description: Optional description for this translator

Credentials Selection

  • Access Key ID: Select the key containing your Lara access key ID
  • Access Key Secret: Select the key containing your Lara secret key

Translation Options

Style Options

Control how Lara translates your content:

  • Faithful: Maintains literal translation, preserves structure
  • Fluid: More natural, conversational translation (recommended for most content)
  • Creative: More adaptive translation, suitable for marketing content

Adapt To

Specify content type for better context: - Blog: Blog posts and articles - Marketing: Marketing materials and promotional content - Technical: Technical documentation, manuals - Legal: Legal documents, contracts - News: News articles and press releases

Instructions

Provide specific translation guidance: - Define terminology preferences - Specify tone and style requirements - Set translation constraints or guidelines

Content Type

  • text/html: Default for Drupal content (preserves formatting)
  • text/plain: Plain text (removes HTML tags)

Language Configuration

Default Mappings

The module provides automatic language code mapping:

Drupal Code Lara Code Language
en en-US English (US)
es es-ES Spanish (Spain)
fr fr-FR French (France)
de de-DE German (Germany)
it it-IT Italian (Italy)
ja ja-JP Japanese (Japan)
ko ko-KR Korean (Korea)
zh-hans zh-CN Chinese (Simplified)
zh-hant zh-TW Chinese (Traditional)

Custom Mappings

Override default mappings by adding custom entries:

  1. In translator configuration, expand Language mappings section
  2. Click Add mapping
  3. Enter:
  4. Drupal language code: Your site's language code (e.g., "en-gb")
  5. Lara language code: Lara's corresponding code (e.g., "en-GB")
  6. Save configuration

Symfony Messenger Configuration

The module uses Symfony Messenger for asynchronous processing. While it works with default settings, you may want to configure transports for production.

Default Configuration

The module automatically: - Registers TranslationJobMessageHandler as a message handler - Uses the default message bus for dispatch - Handles retries through Messenger's built-in mechanisms

Production Considerations

For high-volume sites, consider: - Configuring persistent transports (Redis, database) - Setting up dedicated worker processes - Monitoring message queue health

See Operations Guide for production deployment details.

Advanced Settings

Quota Management

Monitor your Lara API quota usage: - The module tracks quota errors automatically - Transient quota errors trigger automatic retries - Set up alerts for quota exhaustion

Error Handling

Configure how errors are handled: - Permanent errors: Logged immediately, job item marked failed - Transient errors: Automatically retried with exponential backoff - Retry limits: Configure maximum retry attempts

Logging

Configure logging levels: - Info: Normal processing information - Warning: Transient errors and retries - Error: Permanent errors and configuration issues

Logs are available in Drupal's log system (/admin/reports/dblog) with channel tmgmt_laratranslate.

Testing Configuration

Verification Steps

  1. Create a small test translation job
  2. Submit it to your Lara translator
  3. Monitor job status in Translation Management → Jobs
  4. Check logs for any error messages

Common Configuration Issues

  • Authentication errors: Verify API credentials in Key management
  • Network errors: Check firewall rules for Lara API access
  • Language mapping errors: Confirm target languages are supported