Translation Alias
No security coverage
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_aliasEnable the module:
drush en translation_aliasUsage
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-pathBulk 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-2Features
- 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
-
Invalid CSV Format
- Ensure your CSV has the correct headers
- Check for proper column order
- Verify there are no empty rows
-
Entity Not Found
- Verify the entity ID exists
- Check if the entity type is correct
-
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
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.1 | Stable | Jan 1, 2025 |