Posted by Dave Reid on February 20, 2012 at 1:27am
1 follower
Jump to:
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | entity system |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | D8MI, needs backport to D7, pathauto |
Issue Summary
For example, if I enable content translation (either via translation.module or a contrib module) for article node types but not page nodes, those modules should be altering hook_entity_info() for $info['node']['bundles']['article'] to indicate that translating is enabled.
Something like:
<?php
/**
* Implements hook_entity_info_alter().
*/
function translation_entity_info_alter(&$info) {
foreach ($info['node']['bundles'] as $type => &$bundle) {
if (translation_supported_type($type)) {
// Mark that translation.module is providing localization for this content type.
$bundle['translation']['translation'] = TRUE;
}
}
}
?>Would also be nice to have a isTranslatable() method in the default Entity class that we can call as well (and an entity_is_translatable($entity_type, $entity) API addition for D7).
Comments
#1
This would assist the Pathauto contrib project help provide URL aliasing in an entity-generic fashion.