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?

| improve this question | | | | |

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

| improve this answer | | | | |
  • 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 '18 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 '18 at 13:36
  • 1
    Do you have the core modules enabled? Content Translation and Language? – Rainer Feike Jul 3 '18 at 14:07
  • 1
    @RainerFake I've missed configuration at admin/config/regional/content-language from description, thanks – Codium Jul 3 '18 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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