Full site translations
with Entity Translation
Michael Schmid - @Schnitzel
First trials with Entity Translation
why Entity Translation?
• Allows things not possible via Content Translation
• Default in Drupal 8
$body['und'][0]['value'] = "Body";
Can we use that?
YES!
Entity Translation!
• uses Field Translations
• 1 Node for all languages
• changes concepts
Entity TranslationContent Translation
Node 1 Node 2
$language = "en";
$title = "Welcome";
$body['und'][0]['value']
= "Body...
[#557292] Convert node title to fields
[#571654] Revert node titles as fields
[#557292] Convert node title to fields
title module
• https://drupal.org/project/title
• allows to replace title with title_field
• handles loading of right lang...
using Entity Translation
Content Translation
Entity Translation
what to make translatable?
it depends!
what to make translatable
• Everything with Text
• others...
what languages are used for
• actual translation
• also different department informations
• US vs Europe Products
image fields?
• if image contains text
• or you need different images
list fields?
• to translate choices
• i18n field translations
• most probably not translatable
file fields?
• file probably contains text, so yes
entity reference fields?
• No, your referenced entity is translated again
• Use entityreference field!
Node 1
$body['en'][0]['value'] = "Body";
$body['de'][0]['value'] = "Körper";
$field_image['und'][0]['target_id'] = 98;
ent...
Node 1
$body['en'][0]['value'] = "Body";
$body['de'][0]['value'] = "Körper";
$field_image['en'][0]['target_id'] = 99;
$fie...
taxonomy fields?
• most probably not
• translated again
other entities?
file entity translation
• use file_entity module
• title and alt texts are fields
• make translatable
• file itself not tr...
taxonomy entity translation
• can also be translated with i18n_taxonomy
• don't do that anymore!
• now with entity transla...
entity translation settings
original
translation
what to translate?
entity translation settings
upgrade!
Entity Translation Upgrade
Entity Translation Upgrade
• entity_translation_upgrade Module
1. make fields translatable!
2. replace title with title fi...
Issues
Issues
• Field Collections
• [#7735819]
• Views language filter
• Revisions
• Search API
• search_api_et module
Drupal 8
• no Content Translation like D7 anymore
• Entity Translation is called Content Translation
• every Entity is tra...
conclusion
conclusion
• start to use it
• think about what needs to be translatable
• upgrades: test, test, test
• you will still nee...
Entity Translation <3
Demo
Get ready for full translated sites with Entity Translation
Get ready for full translated sites with Entity Translation
Upcoming SlideShare
Loading in...5
×

Get ready for full translated sites with Entity Translation

3,897

Published on

Do you build multilingual websites with D7 and Content Translation today? Wanna build them tomorrow with Drupal 8? This session is for you.

Even Entity Translation already exists in Drupal 7 for quite a while, it's not widely used yet, mostly for Commerce Product translations as it is pretty handy there. If it comes into nodes, Content Translation ist still the prefered system for most sites.

In Drupal 8 there will be only one Translation System: Entity Translation. *oooh noo!*
BUT! There is one really good thing about Entity Translation: It can be already fully used with Drupal 7, so the change from D7 to D8 will be much easier.

Amazee Labs has already started to built Drupal 7 sites only with Entity Translation. It maybe sounds easy to translate a website only with Entity Translation, but there are quite some concepts which completely change. Like Menus, Entity References, Access Rights, Views, Fallbacks, and more.

In this session I want to talk about the biggest learnings we had, what is easy and what is hard to build with Entity Translation, give advice what works well and what not. To make the transition from Content Translation to Entity Translation as easy as possible for everybody.

For the full experience of the animated cat content gif goodness, you can download the Keynote slides at http://blog.amazeelabs.com/en/our-drupal-developer-days-szeged-slides.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,897
On Slideshare
0
From Embeds
0
Number of Embeds
39
Actions
Shares
0
Downloads
9
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Get ready for full translated sites with Entity Translation

  1. 1. Full site translations with Entity Translation Michael Schmid - @Schnitzel
  2. 2. First trials with Entity Translation
  3. 3. why Entity Translation? • Allows things not possible via Content Translation • Default in Drupal 8
  4. 4. $body['und'][0]['value'] = "Body"; Can we use that?
  5. 5. YES!
  6. 6. Entity Translation! • uses Field Translations • 1 Node for all languages • changes concepts
  7. 7. Entity TranslationContent Translation Node 1 Node 2 $language = "en"; $title = "Welcome"; $body['und'][0]['value'] = "Body"; $field_image['und'][0]['fi d'] = 45; $tnid = 1; $language = "de"; $title = "Willkommen"; $body['und'][0]['value'] = "Körper"; $field_image['und'][0]['fi d'] = 45; $tnid = 1; Node 1 $language = "en"; $title = "Welcome"; $body['en'][0]['value'] = "Body"; $body['de'][0]['value'] = "Körper"; $field_image['und'][0]['fid'] = 45;
  8. 8. [#557292] Convert node title to fields
  9. 9. [#571654] Revert node titles as fields [#557292] Convert node title to fields
  10. 10. title module • https://drupal.org/project/title • allows to replace title with title_field • handles loading of right language
  11. 11. using Entity Translation Content Translation Entity Translation
  12. 12. what to make translatable?
  13. 13. it depends!
  14. 14. what to make translatable • Everything with Text • others...
  15. 15. what languages are used for • actual translation • also different department informations • US vs Europe Products
  16. 16. image fields? • if image contains text • or you need different images
  17. 17. list fields? • to translate choices • i18n field translations • most probably not translatable
  18. 18. file fields? • file probably contains text, so yes
  19. 19. entity reference fields? • No, your referenced entity is translated again • Use entityreference field!
  20. 20. Node 1 $body['en'][0]['value'] = "Body"; $body['de'][0]['value'] = "Körper"; $field_image['und'][0]['target_id'] = 98; entity reference fields Node 98 $body['en'][0]['value'] = "Hello"; $body['de'][0]['value'] = "Guten Tag";
  21. 21. Node 1 $body['en'][0]['value'] = "Body"; $body['de'][0]['value'] = "Körper"; $field_image['en'][0]['target_id'] = 99; $field_image['de'][0]['target_id'] = 100; entity reference fields Node 99 $body['en'][0]['value'] = "Hello"; $body['de'][0]['value'] = "Guten Tag"; Node 100 $body['en'][0]['value'] = "My Name is"; $body['de'][0]['value'] = "Mein Name ist";
  22. 22. taxonomy fields? • most probably not • translated again
  23. 23. other entities?
  24. 24. file entity translation • use file_entity module • title and alt texts are fields • make translatable • file itself not translatable
  25. 25. taxonomy entity translation • can also be translated with i18n_taxonomy • don't do that anymore! • now with entity translation
  26. 26. entity translation settings
  27. 27. original
  28. 28. translation
  29. 29. what to translate?
  30. 30. entity translation settings
  31. 31. upgrade!
  32. 32. Entity Translation Upgrade
  33. 33. Entity Translation Upgrade • entity_translation_upgrade Module 1. make fields translatable! 2. replace title with title field 3. run upgrade 4. one Node will get field translations 5. other Nodes unpublished
  34. 34. Issues
  35. 35. Issues • Field Collections • [#7735819] • Views language filter • Revisions • Search API • search_api_et module
  36. 36. Drupal 8 • no Content Translation like D7 anymore • Entity Translation is called Content Translation • every Entity is translated via Entity Translation
  37. 37. conclusion
  38. 38. conclusion • start to use it • think about what needs to be translatable • upgrades: test, test, test • you will still need i18n
  39. 39. Entity Translation <3
  40. 40. Demo
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×