By alexpott on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.3.x
Introduced in version:
10.3.0
Issue links:
Description:
Prior to Drupal 10.3.0 translations where imported in an inconsistent order.
In Drupal 10.3.0 translations will be imported in alphabetical order by the translation project name. The order can be changed by adding a weight key to the translation project using hook_locale_translation_projects_alter.
Example
function my_custom_module_locale_translation_projects_alter(&$projects) {
if (isset($projects['existing_project'])) {
// Move this project to the end of the list of projects to be imported.
$projects['existing_project']['weight'] = 100;
}
}
This example changes the weight of the translations to 100.
Impacts:
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers