I made a custom entity (ty drupal console). but i would also like to make this entity translatable. I enabled all 4 multilingual core modules but i don't see the "translate" tab in my entity nor can i enable translation form the "admin/config/regional/content-language" page (it says N/A), but i can show the language selector which as no real effect.

is it possible to translate custom entity, if so, how? what am i missing?

You need the translatable = TRUE line in your @ContentEntityType annotation. You also need the setTranslatable(TRUE) line in your BaseFieldDefinition::create fields.

  • thanks a bunch, i looked everywhere for this information. you are my hero today :) – Martin Ouellet Jul 19 '16 at 14:39
  • Do you not also need to specify the data_table in the annotation? – joachim Mar 11 at 22:01
  • @RainderFeike and then Translate tab should be available out of the box? For me with above steps not. I have translatable title field + annotation – Codium Jul 3 at 13:36
  • 1
    Do you have the core modules enabled? Content Translation and Language? – Rainer Feike Jul 3 at 14:07
  • @RainerFake I've missed configuration at admin/config/regional/content-language from description, thanks – Codium Jul 3 at 19:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.