Introduces a new alter hook: hook_entity_xliff_translatable_fields_alter(), with the following signature:
/**
* Alter translatable fields for a given entity. Useful for removing or adding
* entity fields and properties to the generated XLIFF.
*
* @param array $fields
* An array of field or property names that represent translatable data.
* Note: the array keys are meaningless and can change at any time,
* You may need to use array_search() to find a specific value.
*
* @param \EntityDrupalwrapper $wrapper
* An entity metadata wrapper for the entity in question, useful for
* context. For examplee, you may wish to conditionally alter
* translatable fields by entity type via $wrapper->type() or entity bundle
* via $wrapper->getBundle().
*/
function hook_entity_xliff_translatable_fields_alter(&$fields, $wrapper) {
if ($wrapper->type() === 'my_entity_type') {
$key = array_search('my_untranslatable_field', $fields);
if ($key !== FALSE) {
unset($fields[$key]);
}
}
}
Also implements this hook on behalf of the Automatic Nodetitles module and the Automatic Entity Labels modules.
Introduces a new alter hook:
hook_entity_xliff_translatable_fields_alter()
, with the following signature:Also implements this hook on behalf of the Automatic Nodetitles module and the Automatic Entity Labels modules.