This project is not covered by Drupal’s security advisory policy.

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

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Multilingual
  • chart icon10 sites report using this module
  • Created by asanchez75 on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases