In the previous tidbits we covered each language and translation capability one by one. The community translates the software interface on http://localize.drupal.org/ which you can customize with Interface translation. You can translate your local configuration and content with the Configuration translation and Content translation modules respectively. However, actual real life use cases are never clear cut like that. Content shows up with some shipped interface elements, local configuration and content. Menus contain elements from code, content and configuration. It is good to know how these pieces relate so you can translate every piece and know the right place to do it.
multilingual
Up to date as of March 14th, 2017.
Now that we covered how content translation workflow works in Drupal 8, its time to look a bit at the API side. In Drupal 7 this meant dealing with scary seemingly infinitely nested arrays with language codes, field names, deltas, etc. Drupal 8 makes this a whole lot simpler.
Up to date as of November 10th, 2015.
In the previous tidbit, we covered content translation basics. In short now you can configure translatability on any subtype of any entity type, so for example articles or specific taxonomy vocabularies may be configured to have all their entities support translation. Then each entity structure may be configured on the field and in some cases subfield level to support translation. The question is how does it all work then, what do we do to translate content?
If you are interested in to learn about, solve your problems with and/or contribute to multilingual Drupal, DrupalCon Barcelona is the place to be. Here is a quick summary of things happening so you don't miss what is going on.
- Extended sprints before and after DrupalCon (19-21 and 26-27 September) are happening, and the multilingual team is there.
- Lingotek is holding a free training on Monday 1-5pm to translate Drupal sites with all the benefits of the lingotek module and services. Also a BoF on the same topic on Thu 10:45 to 11:45am
- Intersted in localize.drupal.org and translating Drupal itself? Come to and discuss at Bring Drupal 8 to all in their native languages on Monday 11am to noon.
- If you'd rather see the real life experience of Acronis, there is also a BoF presentation at the same time (Monday 11am to noon) titled Drupal 7 - Internationalisation for custom enterprise environment
- Drupal 8 comes with a whole new set of multilingual features, which combined with other improvements is even more powerful. Drupal 8 multilingual site building hacks is the place to be to see that in action.
- Just want your problems solved and move on? The multilingual therapy BoF is on for that on Wednesday lunchtime. Bring your lunch and questions/problems.
- If you don't have time or the opportunity to come to the Drupal 8 site building session, get the executive summary at the Acquia booth at 3:15-3:45pm on Wednesday (in the break).
- Tired of all this multilingual stuff? Want to learn how we managed to be so active for four years on so you can get your movement going better too? Your place is at Open source project management in the Drupal community, lessons from the multilingual team Thursday 1pm to 2pm.
- Just want to get stuff done (fix UI text, solve bugs, figure out issues) in core so you don't need to solve them over and over for your customers? We are also at the sprints on Friday and the community is even offering plenty of mentoring if you are entirely new. No excuses to not contribute!
- While not primarily multilingual content, there is also multilingual coverage in Entity storage, the Drupal 8 way, in Our experience with building Drupal 8 Sites in Alpha and Beta, in Configuration management in Drupal 8, in Building sites in Drupal 7 with an eye on Drupal 8, as well as in Let's build it on Drupal 8 and some others I likely missed (sorry for that).
Hope to see you at some of these places!
Drupal 8 packs a historic amount of site building features which make producing websites easier than ever with core or just a couple contributed modules only. There are already various live Drupal 8 multilingual sites using little more but core.
It is hard to grasp the many things with useful levers and knobs in Drupal 8. Think about combining views with entity view modes and blocks; block language visibility with menus; user preferences with comment submission; language filtering and entity rendering; translatable fields with administration views; and so on and on.
Wouldn't it be fun to experiment with the possibilities and come up with clever ways to combine core features to solve common problems? You may be familiar with the name and format of O'Reilly's Hacks Series which reclaims the term "hacking" for the good guysfolks — innovators who explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on their own. The excellent series inspired the name and format of our contest.
Long story short, hereby, we announce the Drupal 8 multilingual site building hacks contest!
Rules
- Come up with clever ways to combine Drupal 8 core features (and if needed one or at most two contributed modules) to fulfill a multilingual site building need.
- Write up the steps taken. See an example in hack #1. (We'll do light editing of the post if needed, don't let perfection be the enemy of good).
- Register on http://drupal8multilingual.org/user to submit entries (requires approval for spam protection).
- Submit entries by end of day (CEST) July 31st.
- One person may submit as many entries as they wish.
- All entries will be published after review (and possible light editing).
What is in it for you?
The top 3 best hacks will receive unique presents from Hook42 and Amazee Labs! (Further sponsors welcome). You'll either receive the presents at DrupalCon Barcelona or we'll mail it to you if you are not coming to DrupalCon. This is of course additionally to the joy of getting to play with some of the less frequented but definitely no less fun features of Drupal 8.
What is in it for us?
All hacks will be published under Creative Commons Attribution-ShareAlike 4.0, so the community will benefit. Additionally to that Gábor Hojtsy and Vijayachandran Mani are building an open source presentation with the best tips (same license). This will be presented at Drupalaton Hungary and DrupalCon Barcelona. Similar to our existing open source workshop, everyone will be able to present this at local meetups and camps or follow along at home at their own pace.
What kind of hacks are we looking for?
Hack #1 is hopefully a good example. Really the only common thread between the hacks would be to satisfy a multilingual site need or use multilingual features in some other clever way (even for features that are not necessarily multilingual). Some ideas for hacks that may help you start off experimenting:
- Swap textual site logo Need to swap a site logo with text on it for different languages? Use a translatable custom block with an image field. Configure the display mode and add some custom CSS if needed.
- Translator todo helper Create a views block for content translators to summarize the number of outdated translations they have to update (and link to content administration filtered to that language)
- Language dependent front page Use block visibility to display up to date content on a well maintained language while an About us / Contact us page on languages where resources are limited to maintain useful fresh content.
Of course these are just some things we made up (although still eligible for the contest). Looking for your creative ideas and solutions!
Questions, concerns? Contact us!
This is a crosspost from http://www.drupal8multilingual.org/hacks.
The Drupal 8 multilingual team is really great in spreading know-how on the new things in the upcoming version, so we had our session (1h) and workshop (2h) recordings published and widely available. While we of course love our baby and can talk all day about it, who has hours when they just want to explore what is coming up? We just addressed that this week with the following.
1. New 2m22s introduction video with the key benefits
2. A quick summary of key benefits and an easy to skim features list
http://www.drupal8multilingual.org/#topbenefits lists the top 12 benefits and http://www.drupal8multilingual.org/features provides the more detailed information in an easy to skim text form. And yeah, that 1h session video if you have the time.
3. Easy to launch demo to try features out
Thanks to our work on the multilingual workshops for DrupalCons, BADCamp and DrupalCamps, we have a demo with sample content in 4 languages that you can try out in your browser for 30 minutes without any registration or local software install required thanks to simplytest.me.
4. Check out who voted with their feet already
Drupal 8 is not yet released, yet there are numerous live multilingual Drupal 8 sites helping with nature preservation, finding health professionals or concert tickets among other good uses. Now there is a handy list to review at http://www.drupal8multilingual.org/showcase.
If you like what you see, we still have guided workshops (those that last 2h). The next one is coming up right this Sunday at DrupalCamp Spain. We also believe that the multilingual team is one of the best to get involved with if you want to know Drupal 8 better and give back some to improve the new version as well. We have weekly meetings and a huge sprint coming up at DrupalCon Barcelona. Maybe we'll have some opportunity to celebrate as well. See you there!
Up to date as of October 29th, 2015.
In the introduction to content and configuration translation piece we discussed what is considered content in Drupal 8. This is a somewhat misleading term because custom blocks, custom menu items and even user entities (user profiles) are considered content in terms of their implementation.
Content is always stored as entities. The main difference between configuration and content entities is configuration is usually created on the backend (think views, vocabularies, etc.) while content is usually created on the frontend (think free tagging taxonomy terms, comments, blog posts). This is not a black and white differentiation but it helps think of the categories. The other key differentiator is content entities usually get to have configurable fields. You can add new fields to user profiles, taxonomy terms or comments. Again there are exceptions, for example custom menu items cannot get configurable fields in core. Finally, there are even content entities that will not be stored, in Drupal 8 contact form submissions are content entities that live only until they are sent via email. For this tidbit we are concerned for content entities that are stored and multilingual.
Whew! 2014 was a fantastic year for the Drupal multilingual team. We had some great events with huge sprints, including but not limited to: Global Sprint Weekend, the amazing Drupal Dev Days Europe, NYC Camp, DrupalCon Austin, DrupalCon Amsterdam and BADCamp.
A fun fact about people on the multilingual team is that even though we usually turn out in big numbers at sprints, there are numerous great mentors among us, so we don't work on code that much at mentored sprints. We do a great job helping people get started and move into more serious core work though. Our most famous mentee this past year is 2014th Drupal 8 core contributor Holly Ross, Executive Director of the Drupal Association who contributed her first and second core patches fixing multilingual issues.
DrupalCon Amsterdam is coming up in just a few weeks and it is full of opportunities to learn about and get all your questions answered when it comes to multilingual Drupal. What's better, you can get involved making things happen and learn from those implementing the features firsthand. Here are my picks:
Multilingual Drupal 8 site building and programming
- There is no excuse to not attend some of the sprints at and around DrupalCon. Sprints start two days ahead of the start of the conference on Saturday the week before. And there are still sprints going on the Sunday after the conference. It is not just the last day of DrupalCon itself where you can get involved and make a difference. In fact the leads are actually focusing more on the sprint on the weekend days. Also the weekend sprints are in a really cool venue. The best way to learn is to do!
- You are looking for more of a directed guide of Drupal 8 still with the possibility to do it all hands-on? Look no further than the Drupal 8 multilingual hands-on lab presented by Aimee Degnan of Hook42 and myself from Acquia. The schedule info is a bit misleading, this session spans two timeslots and lasts two hours. Bring your laptop with Drupal 8 freshly installed!
- Dive deeper into the APIs of Drupal 8! Francesco Placella from Tag1 presents Multilingual Content in D8: a Highly Evolved Permutated API showing how to code with the new system. While not strictly multilingual, in Field API is dead. Long live Entity Field API! swentel, yched and amateescu show how the most essential content element storage system changed and this is full of multilingual support of course.
Multilingual Drupal 7 site building and programming
- Multilingual Site Setup and Management is a half hour session from Robert Vandenberg and Rob Bailey of Lingotek back to back with Building a multilingual & multi-country e-commerce site for luxury brands another half hour talk from Arthur Murauskas of Adyax with real life examples.
- Dagmar Muth and Urs Bucher from Amazee Labs are presenting Building a Multilingual, Multidomain Drupal Site synthesizing their experience from multiple customers.
- I proposed the Multilingual therapy (questions and answers) BoF again! Waiting experienced folks as well as everyone with questions. You'll see even if you arrive with several questions, you can answer others! There is no set agenda, just to answer all the questions!
Moving localize.drupal.org forward
The localize.drupal.org site seriously needs people who care about it enough to devote time to maintaining and fixing bugs. I set up one more BoF to gather people interesting in the well-being of this site titled We love localize.drupal.org. We need to upgrade to Drupal 7, support the whole range of new Drupal 8 APIs, drastically improve performance and then get new features going.
These are all the multilingual pieces that I collected. There may still be more, BoF scheduling just started and I may have missed a session or two. Let us know in the comments what other great events happen around multilingual Drupal. See you in Amsterdam!
Up to date as of October 29th, 2015.
We learned how configuration translation works on the conceptual level and through the Drupal 8 built-in user interfaces in the previous article of the series. In this article, we'll cover how can developers integrate with configuration translation.
Explaining the structure of configuration
We used your main site configuration file as an example in the previous article. Let's review that again (system.site.yml):
uuid: ''
name: ''
mail: ''
slogan: ''
page:
403: ''
404: ''
front: /user/login
admin_compact_mode: false
weight_select_max: 100
langcode: en
default_langcode: en
There are clearly some translatable elements here. Which ones? Well, at least the site name and slogan would be. How would Drupal know though? There is nothing in this file to tell Drupal about that. There is also no code in handling this configuration that needs to deal with that. We wanted to introduce language support in the most transparent way. Instead Drupal supports a static description format to describe the structure of configuration, that we call configuration schema.