Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Overview

This module provides Drush commands to manage path aliases for multilingual content in Drupal 9 and 10.

Requirements

  • Drupal 9.x or 10.x
  • Drush 11.x
  • Path Alias module (core)
  • PHP 8.0 or higher

Installation

Install via composer:

composer require drupal/translation_alias

Enable the module:

drush en translation_alias

Usage

The module provides two Drush commands to manage path aliases for translations:

Single Path Update

Update or create a path alias for a specific entity translation:

drush translation-alias:update-path <entity_id> <entity_type> <langcode> <new_path_alias>

Or using the alias:

drush ta:up <entity_id> <entity_type> <langcode> <new_path_alias>

Example:

drush translation-alias:update-path 123 node fr /fr/my-new-path

Bulk Update

Update multiple path aliases using a CSV file:

drush translation-alias:bulk-update <path/to/file.csv>

Or using the alias:

drush ta:bu <path/to/file.csv>

The CSV file must include the following headers:

entity_id,entity_type,langcode,new_path_alias
123,node,fr,/fr/new-path-1
124,node,es,/es/new-path-2

Features

  • Handles multiple aliases per path/language
  • Preserves alias history
  • Maintains proper revision tracking
  • Ensures only one active alias per path/language
  • Supports all entity types (nodes, taxonomy terms, users, etc.)
  • Provides both single and bulk update capabilities
  • Validates entity and language existence before updating
  • Shows clear progress and status messages

Common Use Cases

  • Migrating translated content with new URL patterns
  • Bulk updating multilingual path aliases
  • Managing URL aliases for different language versions
  • Standardizing path aliases across translations
  • Fixing incorrect language-specific URLs

Troubleshooting

Common Issues

  1. Invalid CSV Format
    • Ensure your CSV has the correct headers
    • Check for proper column order
    • Verify there are no empty rows
  2. Entity Not Found
    • Verify the entity ID exists
    • Check if the entity type is correct
  3. Invalid Language Code
    • Ensure the language is enabled in your site
    • Verify the language code format (e.g., 'en', 'fr', 'es')

Sponsored by https://landportal.org

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.1 Stable Jan 1, 2025