From 1ac10f4b4198ef6a636029d3a76f8f3032f6a71b Mon Sep 17 00:00:00 2001 From: jlbellido Date: Thu, 23 Jun 2016 17:32:45 +0200 Subject: [PATCH 1/4] #2242 : Allow option to generate translatable content entities --- .../en/generate.entity.content.yml | 2 ++ src/Command/Generate/EntityContentCommand.php | 17 ++++++++++++++++- src/Generator/EntityContentGenerator.php | 12 +++++++++++- .../module/src/Entity/entity-content.php.twig | 5 +++++ .../src/entity-translation-handler.php.twig | 18 ++++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 templates/module/src/entity-translation-handler.php.twig diff --git a/config/translations/en/generate.entity.content.yml b/config/translations/en/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/en/generate.entity.content.yml +++ b/config/translations/en/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/src/Command/Generate/EntityContentCommand.php b/src/Command/Generate/EntityContentCommand.php index c0c6b39ce..366b99684 100644 --- a/src/Command/Generate/EntityContentCommand.php +++ b/src/Command/Generate/EntityContentCommand.php @@ -31,6 +31,13 @@ protected function configure() InputOption::VALUE_NONE, $this->trans('commands.generate.entity.content.options.has-bundles') ); + + $this->addOption( + 'is-translatable', + null, + InputOption::VALUE_NONE, + $this->trans('commands.generate.entity.content.options.is-translatable') + ); } /** @@ -50,6 +57,13 @@ protected function interact(InputInterface $input, OutputInterface $output) ); $input->setOption('has-bundles', $bundle_of); } + + // --is-translatable option + $is_translatable = $io->confirm( + $this->trans('commands.generate.entity.content.questions.is-translatable'), + true + ); + $input->setOption('is-translatable', $is_translatable); } /** @@ -65,13 +79,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $base_path = $input->getOption('base-path'); $learning = $input->hasOption('learning')?$input->getOption('learning'):false; $bundle_entity_name = $has_bundles ? $entity_name . '_type' : null; + $is_translatable = $input->hasOption('is-translatable') ? $input->getOption('is-translatable') : true; $io = new DrupalStyle($input, $output); $generator = $this->getGenerator(); $generator->setIo($io); $generator->setLearning($learning); - $generator->generate($module, $entity_name, $entity_class, $label, $base_path, $bundle_entity_name); + $generator->generate($module, $entity_name, $entity_class, $label, $base_path, $is_translatable, $bundle_entity_name); if ($has_bundles) { $this->getChain()->addCommand( diff --git a/src/Generator/EntityContentGenerator.php b/src/Generator/EntityContentGenerator.php index f143713f0..acc935877 100644 --- a/src/Generator/EntityContentGenerator.php +++ b/src/Generator/EntityContentGenerator.php @@ -17,9 +17,10 @@ class EntityContentGenerator extends Generator * @param string $entity_class Entity class name * @param string $label Entity label * @param string $base_path Base path + * @param string $is_translatable Translation configuration * @param string $bundle_entity_type (Config) entity type acting as bundle */ - public function generate($module, $entity_name, $entity_class, $label, $base_path, $bundle_entity_type = null) + public function generate($module, $entity_name, $entity_class, $label, $base_path, $is_translatable, $bundle_entity_type = null) { $parameters = [ 'module' => $module, @@ -28,6 +29,7 @@ public function generate($module, $entity_name, $entity_class, $label, $base_pat 'label' => $label, 'bundle_entity_type' => $bundle_entity_type, 'base_path' => $base_path, + 'is_translatable' => $is_translatable, ]; $this->renderFile( @@ -64,6 +66,14 @@ public function generate($module, $entity_name, $entity_class, $label, $base_pat $parameters ); + if ($is_translatable) { + $this->renderFile( + 'module/src/entity-translation-handler.php.twig', + $this->getSite()->getSourcePath($module).'/'.$entity_class.'TranslationHandler.php', + $parameters + ); + } + $this->renderFile( 'module/src/Entity/interface-entity-content.php.twig', $this->getSite()->getEntityPath($module).'/'.$entity_class.'Interface.php', diff --git a/templates/module/src/Entity/entity-content.php.twig b/templates/module/src/Entity/entity-content.php.twig index 6c47290f0..e4648f5fb 100644 --- a/templates/module/src/Entity/entity-content.php.twig +++ b/templates/module/src/Entity/entity-content.php.twig @@ -33,6 +33,9 @@ use Drupal\user\UserInterface; * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", * "list_builder" = "Drupal\{{ module }}\{{ entity_class }}ListBuilder", * "views_data" = "Drupal\{{ module }}\Entity\{{ entity_class }}ViewsData", +{% if is_translatable %} + * "translation" = "Drupal\{{ module }}\{{ entity_class }}TranslationHandler", +{% endif %} * * "form" = { * "default" = "Drupal\{{ module }}\Form\{{ entity_class }}Form", @@ -46,8 +49,10 @@ use Drupal\user\UserInterface; * }, * }, * base_table = "{{ entity_name }}", +{% if is_translatable %} * data_table = "{{ entity_name }}_field_data", * translatable = TRUE, + {% endif %} * admin_permission = "administer {{ label|lower }} entities", * entity_keys = { * "id" = "id", diff --git a/templates/module/src/entity-translation-handler.php.twig b/templates/module/src/entity-translation-handler.php.twig new file mode 100644 index 000000000..4ca6378ec --- /dev/null +++ b/templates/module/src/entity-translation-handler.php.twig @@ -0,0 +1,18 @@ +{% extends "base/class.php.twig" %} + +{% block namespace_class %} +namespace Drupal\{{module}}; +{% endblock %} + +{% block use_class %} +use Drupal\content_translation\ContentTranslationHandler; +{% endblock %} + +{% block class_declaration %} +/** + * Defines the translation handler for {{ entity_name }}. + */ +class {{ entity_class }}TranslationHandler extends ContentTranslationHandler {% endblock %} +{% block class_methods %} + // Override here the needed methods from ContentTranslationHandler. +{% endblock %} From ebcb6cde361b8216964c9521f7801cb7f64338b3 Mon Sep 17 00:00:00 2001 From: jlbellido Date: Thu, 23 Jun 2016 17:33:35 +0200 Subject: [PATCH 2/4] #2242 : Sync translations to all languages --- config/translations/ca/generate.entity.content.yml | 2 ++ config/translations/es/generate.entity.content.yml | 2 ++ config/translations/fr/generate.entity.content.yml | 2 ++ config/translations/gu/generate.entity.content.yml | 2 ++ config/translations/hi/generate.entity.content.yml | 2 ++ config/translations/hu/generate.entity.content.yml | 2 ++ config/translations/id/generate.entity.content.yml | 2 ++ config/translations/ja/generate.entity.content.yml | 2 ++ config/translations/ko/generate.entity.content.yml | 2 ++ config/translations/mr/generate.entity.content.yml | 2 ++ config/translations/pa/generate.entity.content.yml | 2 ++ config/translations/pt_br/generate.entity.content.yml | 2 ++ config/translations/ro/generate.entity.content.yml | 2 ++ config/translations/ru/generate.entity.content.yml | 2 ++ config/translations/tl/generate.entity.content.yml | 2 ++ config/translations/vn/generate.entity.content.yml | 2 ++ config/translations/zh_hans/generate.entity.content.yml | 2 ++ config/translations/zh_hant/generate.entity.content.yml | 2 ++ 18 files changed, 36 insertions(+) diff --git a/config/translations/ca/generate.entity.content.yml b/config/translations/ca/generate.entity.content.yml index 860bdd3dd..028aa7130 100644 --- a/config/translations/ca/generate.entity.content.yml +++ b/config/translations/ca/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: Etiqueta has-bundles: 'L''entitat conté bundles' base-path: 'El camí base per les rutes de l''entitat de continguts' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Introduïu la classe de la nova entitat de contingut' @@ -14,3 +15,4 @@ questions: label: 'Introduïu l''etiqueta de la nova entitat de contingut' has-bundles: 'Vols que aquest contingut tingui bundles' base-path: 'Introduïu el camí base per les rutes de l''entitat de contigut' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/es/generate.entity.content.yml b/config/translations/es/generate.entity.content.yml index 27c634e2f..cbb76156b 100644 --- a/config/translations/es/generate.entity.content.yml +++ b/config/translations/es/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: Etiqueta has-bundles: 'La entidad tiene bundles' base-path: 'El directorio raíz para las rutas de la entidad de contenido' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Proporcione la clase de la nueva entidad de contenido' @@ -14,3 +15,4 @@ questions: label: 'Proporcione la etiqueta de la nueva entidad de contenido' has-bundles: 'Desea que esta entidad de contenido tenga bundles' base-path: 'Proporcione el directorio raíz para las rutas de la entidad de contenido' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/fr/generate.entity.content.yml b/config/translations/fr/generate.entity.content.yml index 5302d9c2e..07eb74b44 100644 --- a/config/translations/fr/generate.entity.content.yml +++ b/config/translations/fr/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'Le libellé' has-bundles: 'Est-ce que l''entité possède des bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Entrez le nom de votre classe pour votre nouvelle entité de contenu' @@ -14,3 +15,4 @@ questions: label: 'Entrez le libellé de votre nouvelle entité de contenu' has-bundles: 'Voulez-vous que cette entité possède des bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/gu/generate.entity.content.yml b/config/translations/gu/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/gu/generate.entity.content.yml +++ b/config/translations/gu/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/hi/generate.entity.content.yml b/config/translations/hi/generate.entity.content.yml index e68bddcd5..9cfde15d3 100644 --- a/config/translations/hi/generate.entity.content.yml +++ b/config/translations/hi/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: लेबल has-bundles: 'एंटिटि मॆ बंडल हे' base-path: 'कॉन्फिग एंटिटी रुट्स के लिए बेस पथ' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'अपने नई कंटेंट एंटिटि की कक्षा लिखॆ' @@ -14,3 +15,4 @@ questions: label: 'अपने नई कंटेंट एंटिटि का लेबल लिखॆ' has-bundles: 'आप (कंटेंट) एंटिटि मे बंडल चाहते हैं' base-path: 'कॉन्फिग एंटिटी रुट्स के लिए बेस पथ दर्ज करे' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/hu/generate.entity.content.yml b/config/translations/hu/generate.entity.content.yml index 04cd76e47..fb9691cc2 100644 --- a/config/translations/hu/generate.entity.content.yml +++ b/config/translations/hu/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'A felirat' has-bundles: 'Az entitás nem rendelkezik mezőcsoportokkal' base-path: 'A tartalom entitás útvonalak alapútvonala' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Meg kell adni az új tartalom entitás osztályát' @@ -14,3 +15,4 @@ questions: label: 'Meg kell adni az új tartalom entitás feliratát' has-bundles: 'Ez a tartalom entitás rendelkezzen mezőcsoportokkal?' base-path: 'Meg kell adni a tartalom entitás útvonalak alapútvonalát' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/id/generate.entity.content.yml b/config/translations/id/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/id/generate.entity.content.yml +++ b/config/translations/id/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/ja/generate.entity.content.yml b/config/translations/ja/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/ja/generate.entity.content.yml +++ b/config/translations/ja/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/ko/generate.entity.content.yml b/config/translations/ko/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/ko/generate.entity.content.yml +++ b/config/translations/ko/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/mr/generate.entity.content.yml b/config/translations/mr/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/mr/generate.entity.content.yml +++ b/config/translations/mr/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/pa/generate.entity.content.yml b/config/translations/pa/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/pa/generate.entity.content.yml +++ b/config/translations/pa/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/pt_br/generate.entity.content.yml b/config/translations/pt_br/generate.entity.content.yml index 956b281a0..8a9514c3f 100644 --- a/config/translations/pt_br/generate.entity.content.yml +++ b/config/translations/pt_br/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'O rótulo' has-bundles: 'A entidade tem bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Digite a classe da sua nova entidade de conteúdo' @@ -14,3 +15,4 @@ questions: label: 'Digite o rótulo da sua nova entidade de conteúdo' has-bundles: 'Deseja que esta entidade de conteúdo tenha bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/ro/generate.entity.content.yml b/config/translations/ro/generate.entity.content.yml index 7c0226afd..cfe6caa97 100644 --- a/config/translations/ro/generate.entity.content.yml +++ b/config/translations/ro/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: Eticheta has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Introduceți clasa noii dvs. entități de conținut' @@ -14,3 +15,4 @@ questions: label: 'Introduceți eticheta noii dvs. entități de conținut' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/ru/generate.entity.content.yml b/config/translations/ru/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/ru/generate.entity.content.yml +++ b/config/translations/ru/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/tl/generate.entity.content.yml b/config/translations/tl/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/tl/generate.entity.content.yml +++ b/config/translations/tl/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/vn/generate.entity.content.yml b/config/translations/vn/generate.entity.content.yml index fb4b0438c..2282ebb72 100644 --- a/config/translations/vn/generate.entity.content.yml +++ b/config/translations/vn/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: Nhãn has-bundles: 'Entity có các bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Nhập lớp của config entity mới của bạn' @@ -14,3 +15,4 @@ questions: label: 'Nhập nhãn của config entity mới của bạn' has-bundles: 'Bạn có muốn (content) entity này có bundles không' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' diff --git a/config/translations/zh_hans/generate.entity.content.yml b/config/translations/zh_hans/generate.entity.content.yml index c2c6c4acd..bc0611dd6 100644 --- a/config/translations/zh_hans/generate.entity.content.yml +++ b/config/translations/zh_hans/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 标签 has-bundles: '实体包含 Bundles' base-path: 内容实体路由的基本路径 + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 输入新内容实体的类名 @@ -14,3 +15,4 @@ questions: label: 输入新内容实体的标签 has-bundles: '这个(内容)实体包含 Bundles 吗?' base-path: 输入内容实体路由的基本路径 + is-translatable: 'Is your entity translatable' diff --git a/config/translations/zh_hant/generate.entity.content.yml b/config/translations/zh_hant/generate.entity.content.yml index 708dd767d..99ed0f3ea 100644 --- a/config/translations/zh_hant/generate.entity.content.yml +++ b/config/translations/zh_hant/generate.entity.content.yml @@ -7,6 +7,7 @@ options: label: 'The label' has-bundles: 'Entity has bundles' base-path: 'The base-path for the content entity routes' + is-translatable: 'Content entity translatable' questions: module: common.questions.module entity-class: 'Enter the class of your new content entity' @@ -14,3 +15,4 @@ questions: label: 'Enter the label of your new content entity' has-bundles: 'Do you want this (content) entity to have bundles' base-path: 'Enter the base-path for the content entity routes' + is-translatable: 'Is your entity translatable' From 98812e97185d979affd20d61b2f4d663f28e286e Mon Sep 17 00:00:00 2001 From: jlbellido Date: Thu, 23 Jun 2016 18:07:00 +0200 Subject: [PATCH 3/4] #2242 : Fix Generate entity content tests --- Test/DataProvider/EntityContentDataProviderTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test/DataProvider/EntityContentDataProviderTrait.php b/Test/DataProvider/EntityContentDataProviderTrait.php index 3fe77f6b2..91ccdb9e4 100644 --- a/Test/DataProvider/EntityContentDataProviderTrait.php +++ b/Test/DataProvider/EntityContentDataProviderTrait.php @@ -16,7 +16,7 @@ public function commandData() $this->setUpTemporaryDirectory(); return [ - ['Foo', 'foo' . rand(), 'Bar', 'bar', 'admin/structure'], + ['Foo', 'foo' . rand(), 'Bar', 'bar', 'admin/structure', 'true'], ]; } } From ff76d6faf14eed0e45fd4753a9755400a5ad2477 Mon Sep 17 00:00:00 2001 From: jlbellido Date: Thu, 23 Jun 2016 18:22:22 +0200 Subject: [PATCH 4/4] #2242 : Fix Generate entity content tests --- Test/Generator/EntityContentGeneratorTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Test/Generator/EntityContentGeneratorTest.php b/Test/Generator/EntityContentGeneratorTest.php index 7a81e3ae3..31e0eca54 100644 --- a/Test/Generator/EntityContentGeneratorTest.php +++ b/Test/Generator/EntityContentGeneratorTest.php @@ -30,7 +30,8 @@ public function testGenerateEntityContent( $entity_name, $entity_class, $label, - $base_path + $base_path, + $is_translatable ) { $generator = new EntityContentGenerator(); $this->getRenderHelper()->setSkeletonDirs($this->getSkeletonDirs()); @@ -42,7 +43,8 @@ public function testGenerateEntityContent( $entity_name, $entity_class, $label, - $base_path + $base_path, + $is_translatable ); $files = [