Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2242 [generate:entity:content] Allow option to generate translatable content entities #2445

Conversation

jlbellido
Copy link
Contributor

This pull request try to solve #2242

  • Added a new option for set the new content entities as translatable or not.
  • In case the entity is set as translatable the annotation is updated according to that and a translationHandler class is added. Nothing is done in other case.
$ drupal-console generate:entity:content
 Enter the module name [block_example]:
 > lopd

 Enter the class of your new content entity [DefaultEntity]:
 > ContentEntity

 Enter the name of your new content entity [content_entity]:
 > 

 Enter the label of your new content entity [Content entity]:
 > 

 Enter the base-path for the content entity routes [/admin/structure]:
 > 


 Do you want this (content) entity to have bundles (yes/no) [no]:
 > 

 Is your entity translatable (yes/no) [yes]:

@enzolutions
Copy link
Contributor

I can’t see the difference between an entity generated with support to translation to an entity without the support in Drupal UI

Please could you provide a way to test this change.

@jlbellido
Copy link
Contributor Author

This issue is a follow up of #2393 where we set the content entities as translatable always. We think that its better if we allow to the users to select if the want the entity translatable or not instead of create it always translatable.

For checking the difference between translatable and no-translatable entities in the Drupal UI you only have to follow this steps:

  • Enable the language and content_translation modules
  • Generate 2 content entities using the console, one translatable and another one no.
  • Go to admin/config/regional/content-language
  • Check that both entities are present on the list of entities.
  • Notice that you only can mark the translatable entity as translatable and choose the fields that can be translated.
  • This doesn't happen wih the no translatable entity.
    console-entity-content-content-translation

@enzolutions
Copy link
Contributor

Thanks @jlbellido

@enzolutions enzolutions merged commit 1abd60c into hechoendrupal:master Jun 25, 2016
@enzolutions enzolutions modified the milestones: 1.0.0-beta3, 1.0.0-beta4 Jun 25, 2016
@enzolutions
Copy link
Contributor

Works as you explain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants