Commit 40ba76c7 authored by alexpott's avatar alexpott

Issue #2478535 by phillamb168, sasanikolic, jhodgdon: Rewrite the...

Issue #2478535 by phillamb168, sasanikolic, jhodgdon: Rewrite the documentation of content_translation_entity_type_alter()
parent 5eb13a95
......@@ -82,33 +82,32 @@ function content_translation_language_types_info_alter(array &$language_types) {
* To make Content Translation automatically support an entity type some keys
* may need to be defined, but none of them is required unless the entity path
* is different from the usual /ENTITY_TYPE/{ENTITY_TYPE} pattern (for instance
* "/taxonomy/term/{taxonomy_term}"), in which case at least the 'canonical' key
* in the 'links' entity info property must be defined.
*
* Every entity type needs a translation handler to be translated. This can be
* specified through the 'translation' key in the 'handlers' entity annotation
* property. If an entity type is translatable and no translation handler is
* defined, \Drupal\content_translation\ContentTranslationHandler will be
* assumed. Every translation handler must implement
* \Drupal\content_translation\ContentTranslationHandlerInterface.
*
* By default, entity types that do not have a canonical link template cannot be
* enabled for translation. This can be overridden by setting the
* 'content_translation_ui_skip' key to true. When that key is set, the Content
* Translation module will not provide any UI for translating the entity type,
* and the entity type should implement its own UI. This is useful for (e.g.)
* entity types that are embedded into others for editing (which would not need
* a canonical link, but could still support translation).
*
* To implement its business logic the content translation UI relies on various
* metadata items describing the translation state. The default implementation
* is provided by \Drupal\content_translation\ContentTranslationMetadataWrapper,
* which is relying on one field for each metadata item (field definitions are
* provided by the translation handler). Entity types needing to customize this
* behavior can specify an alternative class through the
* 'content_translation_metadata' key in the entity type definition. Every
* content translation metadata wrapper needs to implement
* \Drupal\content_translation\ContentTranslationMetadataWrapperInterface.
* "/taxonomy/term/{taxonomy_term}"). Here are a list of those optional keys:
* - canonical: This key (in the 'links' entity info property) must be defined
* if the entity path is different from /ENTITY_TYPE/{ENTITY_TYPE}
* - translation: This key (in the 'handlers' entity annotation property)
* specifies the translation handler for the entity type. If an entity type is
* translatable and no translation handler is defined,
* \Drupal\content_translation\ContentTranslationHandler will be assumed.
* Every translation handler must implement
* \Drupal\content_translation\ContentTranslationHandlerInterface.
* - content_translation_ui_skip: By default, entity types that do not have a
* canonical link template cannot be enabled for translation. Setting this key
* to TRUE overrides that. When that key is set, the Content Translation
* module will not provide any UI for translating the entity type, and the
* entity type should implement its own UI. This is useful for (e.g.) entity
* types that are embedded into others for editing (which would not need a
* canonical link, but could still support translation).
* - content_translation_metadata: To implement its business logic the content
* translation UI relies on various metadata items describing the translation
* state. The default implementation is provided by
* \Drupal\content_translation\ContentTranslationMetadataWrapper, which is
* relying on one field for each metadata item (field definitions are provided
* by the translation handler). Entity types needing to customize this
* behavior can specify an alternative class through the
* 'content_translation_metadata' key in the entity type definition. Every
* content translation metadata wrapper needs to implement
* \Drupal\content_translation\ContentTranslationMetadataWrapperInterface.
*
* If the entity paths match the default pattern above and there is no need for
* an entity-specific translation handler, Content Translation will provide
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment