SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
Multilingual sites
    in Drupal 7:
New features, new possibilities

              Grigory Naumovets
                 Kiev, Ukraine


                                  1
Gold Sponsor of
DrupalCamp Kyiv 2011
Silver Sponsors of
DrupalCamp Kyiv 2011
Outline
1. Support of multilingual content in Drupal:
   an overview
2. New multilingual features in D7 core
3. New multilingual features in D7 versions of
   contributed modules (i18n etc.)
4. Summary of most important improvements in
   multilingual functionality
A5.Problems and prospects


                                                 2
It’s a followup presentation to:
Multilingual sites in Drupal:
Problems, solutions, workarounds,
and “goodness on the way”
(DrupalCamp Kyiv 2009)
www.slideshare.net/Tinnka/multilanguage-drupal
gn.org.ua/drupal/presentations/DrupalCamp_2009-2010

      2009 ----> 2011:
      • Has anything essential changed with the release of
        Drupal 7?
      • Is “multilingual goodness” already approaching, or
        still on the way?

                                                             3
What is ”i18n” and ”L10n”?
 internationalization              i18n

                            18 letters omitted
                            10 letters omitted
       Localization          L10n

These abbreviations are used in the names of
Drupal modules, such as “i18n” or “L10n_client”


                                                  4
If Drupal nodes were designed as
  multilingual from the very beginning…
node/1
                         Title (lang1)       Title (lang2)
(multilingual)
                        Body (lang1)        Body (lang2)
                 Some field (lang1)           Some field (lang2)

                       Another field (language-neutral)


       Some file attached (lang1)        Some file attached (lang2)

                   Another file attached (language-neutral)
comments

                                                                      5
However, Drupal nodes are unilingual.
        i18n is an external feature.
node/1                  Title          node/2                  Title
(unilingual)                           (unilingual)
lang1                  Body            lang2                  Body

                Some field                             Some field

               Another field                          Another field

      Some file attached                       Some file attached
           Another file attached             Another file attached

comments
               Drupal i18n system: I hereby declare node/1      comments
               and node/2 to be translations of each other
                                                                       6
Multilanguage: inside or outside?
Two possible approaches to i18n:
1. Multilingual features inside an object
2. Unilingual object, multilanguage features are
   applied from outside as a system of
   connections to other objects


“Object” can be a node, a block, a taxonomy term,
   a menu, a menu item, and so on.



                                                    7
Inside vs outside
• Drupal uses both approaches (depending on the
  object type), so improvements of multilang support
  proceed in two ways:
  – Making objects “more multilingual”
  – Improving the system of i18n-related connections
    between unilingual objects
• Each approach has its advantages and difficulties
• Until recently, approach to nodes was only “from
  outside”
• Some problems caused by this approach will be
  demonstrated below


                                                       8
No field-level language attributes:
Why it can be a problem? Example 1
node/1     Title                      Title        node/2
lang1                translation                    lang2
          Body                       Body




                   synchronization
    Image field                      Image field


                                                            9
No field-level language attributes:
    Why it can be a problem? Example 2
node/3 (en)        translation     node/4 (ru)
 event info                         event info

nodereference                      nodereference

                  translation       node/2 (ru)
node/1 (en)
location info                      location info

     You need to synchronize nodereferences
                   (i18nsync)

                                                   10
Problem with multilingual views based on
              nodereference
en/events/by-location/             ru/events/by-location/
  Events grouped by locations:       Распределение событий по
                                     месту проведения:
   – Kiev (6)
                                      – Киев (6)
   – Chişinău (4)                     – Кишинёв (4)
                               en  ru

en/events/by-location/36            ru/events/by-location/37
  List of events in Chişinău          Список событий в Кишинёве
                               en  ru
“Chişinău” (node/36) and “Кишинёв” (node/37) are different nodes,
  so when you switch language EN -> RU while viewing the “List of
  events in Chişinău” you will see an empty list instead of “Список
  событий в Кишинёве”.
                                                                      11
Inside vs outside
• However, the “outside” approach can have
  some advantages, too
  – It can be simpler to do or maintain
  – It can utilize such node-level things as access
    permissions for nodes having certain attributes (e.g.
    when you have different people working with nodes
    in different languages), and so on
• It’s highly desirable to have both possibilities,
  and choose between them depending on the
  specific situation.

                                                            12
Now, let us look at the D7 core
• Modules included in D7 core (same as for D6):
  – Content Translation
  – Locale
                  (disabled by default)




                                                  13
Site configuration settings:
“Regional and Language” section




                       Available after
                       enabling the
                       “Locale” module


                                     14
Regional settings
                New in D7:
    • Now you can set “Default country”
     (to be used by contributed modules)
    • More intelligent time zone handling
     (with PHP 5.2+ DateTime objects)




                                            15
Date and time settings
• More control over date and time format




                                           16
Configuration of Languages:
  Detection and selection




                           New in D7:
                     • Finer control over
                       language detection
                       and selection
                     • We can set order of
                       priorities

                                         17
Interface translation

                       New in D7:
                  • Improved user
                    interface
                  • Support for
                    context




                                    18
Contexts are intended for
per-meaning translatability
                                  Context:
                                   “May” as
                                   Long month name
                                   (not “may be”)




   Context is a new feature; guidelines still need to
   be developed. So far, used inconsistently. Not
   supported by Javascript menu items and strings.
                                                        19
Localization auto-update
• Localization update module by Jose Reyero
  (L10n_update)
• Works similarly to Drupal core update module
• Downloads translation updates from
  localize.drupal.org (or from custom depository)
• Available both for D7 and D6
  (v. 7.x-1.0-beta2 and 6.x-1.0-beta1
  of 2011-May-31)



                                                    20
“Cheat sheets” for localizers
               (“шпаргалки”)
• Drupal 7 localization cheat sheet
  Drupal 6 localization cheat sheet
  by Gábor Hojtsy
 hojtsy.hu/files/Drupal7TranslationCheatSheetv2.pdf
 hojtsy.hu/files/Drupal6TranslationCheatSheetv2.pdf




                                                      21
Now about content translation

Enable multilingual
support in content
type properties:
Looking for this in
“Publishing options”
is not really obvious




                                      22
Now we can control ‘node.language’
attribute for nodes of this content type
                  • By default, a new node
                    is Language neutral


                        New in D7:
      For language-neutral nodes, database field
      node.language = ‘und’
      ‘und’ means ‘undetermined’
      in compliance with ISO 639


                                                   23
Node translation
 (same as in D6)
    “Translate” tab is seen
       when:
    1. This content type has
       multilingual support
       “Enabled, with translation”
    2. This node is
       NOT language neutral
    3. User is permitted to translate
       content

                                    24
“Translation set” (same as in D6)
           node/1                     node/2
        Base node               Translated node
        node.nid=1                 node.nid=2
     node.language=‘en’         node.language=‘uk’
        node.tnid=1                node.tnid=1

                                      node/3
                                 Translated node
‘tnid’ – translation set id         node.nid=3
is shared by all nodes in a     node.language=‘ru’
translation set                     node.tnid=1
is equal to ‘nid’ of the base
node

                                                     25
And now something really new…
    D7 core has built-in support for field
   languages!!! (via its new Field API)
    However, D7 has NO built-in interface for
   translatable fields
    We need to use some contributed
    modules



                                             26
Entity_translation module
            Can be used to translate fields
New item in “Regional and language settings” –
 “Entity translation”




                                                 27
Entity translation
New option for multilingual support in content type properties




                                 Field settings:
                                 “Users may translate this
                                 field”




                                                                 28
Single node with multilingual body and
 other fields: wow, it [almost] works!
example.com/node/1     example.com/uk/node/1




         Node title is a different kind of field
         and cannot be translated this way!!!
                                                   29
‘Title’ module: replace node title
         with a regular field




                                     30
Single node with multilingual body and other
  fields: now the title can be translated, too!

example.com/node/1        example.com/uk/node/1




           Node title is now replaced with a
           regular field using ‘Title’ module
                                                  31
Entity_translation + Title:
  is this already the “multilingual field goodness”?

• These modules are very recent, still at the ‘dev’
  stage (v. 7.x-1.x-dev)
• As of June 2, 2011,
  – 130 sites currently report using ‘Entity_translation’
  – 59 sites currently report using ‘Title’
• Still quite a lot of todo’s
• We need to test its interactions with views.
  taxonomy, paths, and so on.


                                                            32
Now about the i18n.module

– Q: Can I build a multilingual site using only the
  core D7 functionality?
– A: A very simple site – yes, but for more
  complex things you’ll need the i18n.module.

  i18n helps you handle multilingual blocks,
  menus, views, synchronization of items
  between nodes, and so on.



                                                      33
Enabling multilingual variables in i18n/D6: add their
        names (site_name, site_footer,
 theme_settings, etc.) to the settings.php file
$conf['i18n_variables'] = array(
   // Site name, slogan, mission, etc..
   'site_name',
   'site_slogan',
   'site_mission',
   'site_footer',
   'anonymous',
   // Different front page for each language
   'site_frontpage',
   // Primary and secondary links
   'menu_primary_links_source',
   'menu_secondary_links_source',
   // Contact form information
   'contact_form_information',
   // For theme variables, read more below
   'theme_settings',
   'theme_garland_settings',
);

                                                        34
i18n/D7 does not work this way anymore




              Now multilingual variables are
                       controlled via
             “Multilingial settings – Variables”
                            menu

                  (Depends on the new
                    variable.module)               35
Multilingual variables




    A very convenient link to switch
                languages
   (especially if there is no language
     switcher in the admin theme)

                                         36
New in D7 and important:
         Translation set API
            (i18n_translation.module)
• Now we can create translation sets not only for
  nodes, but for other things, too:
  – taxonomy terms
  – menu items
  – paths
• Not implemented yet for blocks



                                                    37
Taxonomy terms




Connect different terms as translations of
                each other:
This option was available in D6, too – but it
            did not really work.
          Now (I hope) it should!
                                                38
New: Path translation (i18n_path.module)




        • Intended for translation of generic paths
          that don't have other way of being
          translated.
        • From any of these pages, the language
          switcher will point to the other path for each
          language.
        • Note: path translations must be defined
          without aliases.
                                                           39
Menu translation




• Thanks to Translation set API, now we can
  translate menu items pointing to specific
  nodes, e.g.:
  (en) -> node/1
  (uk) -> node/2
                                              40
Blocks




• Translation sets not working for Blocks
  yet(?)
• Improved UI and visibility options
• Block can be translated via string
  translation
                                            41
Other improvements in i18n
• More options and improved UI for content
  selection and filtering by language
• More items can be synchronized between
  translation set nodes (because more items are
  available as Fields)
• Translation redirect (i18n_redirect.module):
  redirect to translated path when available (SEO
  optimization)
• Contact form translation (i18n_contact.module)
  – recently added

                                                    42
Berlin Internationalization sprint
         (May 11-15, 2011)
• i18nsprint.drupalevents.de
• reyero.net/en/drupal/berlin_internationalization_
  sprint: “How i18n got some fresh blood and a
  sexy facelift”
• i18n 7.x-1.0-beta6 (May 24, 2011)
  includes improvements from Berlin i18n sprint.
  New features:
  – Consistent translation tabs for objects
  – Contact form translation


                                                      43
Summary of most important changes
        in D7 and i18n/D7
• D7:
  – Translation of fields within a node
    (no built-in UI yet, available via recently contributed
    modules)
• i18n/D7:
  – Translation sets
    (connecting taxonomy terms, menu items, paths, etc.)


• Plus lots of less important improvements in UI,
  content selection and filtering, etc.

                                                              44
References
• Drupal 7's new multilingual systems compilation
  by Gábor Hojtsy
  hojtsy.hu/multilingual-drupal7
• Drupal 7 Multilingual: What is new in i18n
  by Suzanne Kennedy
  evolvingweb.ca/story/drupal-7-multilingual-whats-new-i18n
• Multilanguage for Drupal 7: Internationalization module
  (i18n beta1) by Jose Reyero
  reyero.net/en/drupal/drupal7_i18n_beta1_overview
• Content Translation (field translation) in Drupal 7: First
  steps by Randy Fay (read discussions in the comments,
  too!)
  randyfay.com/node/88

                                                               45
Questions?
               Contacts:

    http://camp11.drupal.ua/users/GN

    gnaumovets@gmail.com

    http://gn.org.ua/feedback




                                       46

Weitere ähnliche Inhalte

Andere mochten auch

Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011camp_drupal_ua
 
Fannie Mae Home Path Renovation Loans
Fannie Mae Home Path Renovation LoansFannie Mae Home Path Renovation Loans
Fannie Mae Home Path Renovation LoansRoy Hard
 
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...Tamar Naskidashvili
 
Multi Definicions
Multi DefinicionsMulti Definicions
Multi Definicionsnmoradell
 
What are the HIV prevention needs of male-to-female transgender persons ?
What are the HIV prevention needs of male-to-female transgender persons ?What are the HIV prevention needs of male-to-female transgender persons ?
What are the HIV prevention needs of male-to-female transgender persons ?Santé des trans
 
Vaccination in WHO - European Region
Vaccination in WHO - European RegionVaccination in WHO - European Region
Vaccination in WHO - European RegionTamar Naskidashvili
 
The Black Sea Countries Coalition on Breast and Cervical Cancer Prevention
The  Black Sea Countries  Coalition on Breast and Cervical Cancer PreventionThe  Black Sea Countries  Coalition on Breast and Cervical Cancer Prevention
The Black Sea Countries Coalition on Breast and Cervical Cancer PreventionTamar Naskidashvili
 

Andere mochten auch (12)

Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
Alexandr Shvets.Trends in drupal.DrupalCamp Kyiv 2011
 
Fannie Mae Home Path Renovation Loans
Fannie Mae Home Path Renovation LoansFannie Mae Home Path Renovation Loans
Fannie Mae Home Path Renovation Loans
 
Guidelines for group work
Guidelines for group workGuidelines for group work
Guidelines for group work
 
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...
Working Meeting on Comprehensive Cervical Cancer Prevention and Control in UN...
 
Chenxuxu
ChenxuxuChenxuxu
Chenxuxu
 
Achkasova tns telco-form_08.06.11
Achkasova tns telco-form_08.06.11Achkasova tns telco-form_08.06.11
Achkasova tns telco-form_08.06.11
 
Multi Definicions
Multi DefinicionsMulti Definicions
Multi Definicions
 
What are the HIV prevention needs of male-to-female transgender persons ?
What are the HIV prevention needs of male-to-female transgender persons ?What are the HIV prevention needs of male-to-female transgender persons ?
What are the HIV prevention needs of male-to-female transgender persons ?
 
Vaccination in WHO - European Region
Vaccination in WHO - European RegionVaccination in WHO - European Region
Vaccination in WHO - European Region
 
Central asia
Central asiaCentral asia
Central asia
 
The Black Sea Countries Coalition on Breast and Cervical Cancer Prevention
The  Black Sea Countries  Coalition on Breast and Cervical Cancer PreventionThe  Black Sea Countries  Coalition on Breast and Cervical Cancer Prevention
The Black Sea Countries Coalition on Breast and Cervical Cancer Prevention
 
Lavrukhin onexim telco-form_08.06.11
Lavrukhin onexim telco-form_08.06.11Lavrukhin onexim telco-form_08.06.11
Lavrukhin onexim telco-form_08.06.11
 

Ähnlich wie Multilingual sites in Drupal 7: New features, new possibilities

Multilingual Content in Drupal 7 & 8 at DrupalCon Munich
Multilingual Content in Drupal 7 & 8 at DrupalCon MunichMultilingual Content in Drupal 7 & 8 at DrupalCon Munich
Multilingual Content in Drupal 7 & 8 at DrupalCon MunichSuzanne Dergacheva
 
Bring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesBring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesSébastien Corbin
 
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportDrupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportAcquia
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196Mahmoud Samir Fayed
 
Multilingual Content: Presentation from DrupalCamp Montreal 2012
Multilingual Content: Presentation from DrupalCamp Montreal 2012Multilingual Content: Presentation from DrupalCamp Montreal 2012
Multilingual Content: Presentation from DrupalCamp Montreal 2012Suzanne Dergacheva
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181Mahmoud Samir Fayed
 
Code, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers wayCode, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers wayAlex Baitov
 
Barcelona Multilanguage
Barcelona MultilanguageBarcelona Multilanguage
Barcelona Multilanguageguest3a6661
 
Beyond English - Make Your Android App a Global Success
Beyond English - Make Your Android App a Global SuccessBeyond English - Make Your Android App a Global Success
Beyond English - Make Your Android App a Global SuccessMotorola Mobility - MOTODEV
 
Introduction to SDL Passolo
Introduction to SDL PassoloIntroduction to SDL Passolo
Introduction to SDL PassoloAnnie Markova
 
Translating software with SDL Passolo
Translating software with SDL PassoloTranslating software with SDL Passolo
Translating software with SDL PassoloSDL Trados
 
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfPyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfEmbarcadero Technologies
 
Drupal Internationalization Presentation at OSCMS
Drupal Internationalization Presentation at OSCMS Drupal Internationalization Presentation at OSCMS
Drupal Internationalization Presentation at OSCMS DevelopmentSeed
 
Babel and Beyond - Professional Multilingual Solutions with Drupal
Babel and Beyond - Professional Multilingual Solutions with DrupalBabel and Beyond - Professional Multilingual Solutions with Drupal
Babel and Beyond - Professional Multilingual Solutions with DrupalAcquia
 
Internationalisation In Rails
Internationalisation In RailsInternationalisation In Rails
Internationalisation In RailsRishav Dixit
 
Smart Internationalization assistance and resource translation tools
Smart Internationalization assistance and resource translation toolsSmart Internationalization assistance and resource translation tools
Smart Internationalization assistance and resource translation toolsmreiterer
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31Mahmoud Samir Fayed
 

Ähnlich wie Multilingual sites in Drupal 7: New features, new possibilities (20)

Multilingual Content in Drupal 7 & 8 at DrupalCon Munich
Multilingual Content in Drupal 7 & 8 at DrupalCon MunichMultilingual Content in Drupal 7 & 8 at DrupalCon Munich
Multilingual Content in Drupal 7 & 8 at DrupalCon Munich
 
Bring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languagesBring drupal 8 to all in their native languages
Bring drupal 8 to all in their native languages
 
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportDrupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196
 
Multilingual Content: Presentation from DrupalCamp Montreal 2012
Multilingual Content: Presentation from DrupalCamp Montreal 2012Multilingual Content: Presentation from DrupalCamp Montreal 2012
Multilingual Content: Presentation from DrupalCamp Montreal 2012
 
Multilingual drupal 7
Multilingual drupal 7Multilingual drupal 7
Multilingual drupal 7
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181
 
Code, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers wayCode, ci, infrastructure - the gophers way
Code, ci, infrastructure - the gophers way
 
Multilingual Drupal
Multilingual DrupalMultilingual Drupal
Multilingual Drupal
 
Barcelona Multilanguage
Barcelona MultilanguageBarcelona Multilanguage
Barcelona Multilanguage
 
Beyond English - Make Your Android App a Global Success
Beyond English - Make Your Android App a Global SuccessBeyond English - Make Your Android App a Global Success
Beyond English - Make Your Android App a Global Success
 
Introduction to SDL Passolo
Introduction to SDL PassoloIntroduction to SDL Passolo
Introduction to SDL Passolo
 
Translating software with SDL Passolo
Translating software with SDL PassoloTranslating software with SDL Passolo
Translating software with SDL Passolo
 
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfPyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdf
 
Drupal Internationalization Presentation at OSCMS
Drupal Internationalization Presentation at OSCMS Drupal Internationalization Presentation at OSCMS
Drupal Internationalization Presentation at OSCMS
 
SAPUI5Role
SAPUI5RoleSAPUI5Role
SAPUI5Role
 
Babel and Beyond - Professional Multilingual Solutions with Drupal
Babel and Beyond - Professional Multilingual Solutions with DrupalBabel and Beyond - Professional Multilingual Solutions with Drupal
Babel and Beyond - Professional Multilingual Solutions with Drupal
 
Internationalisation In Rails
Internationalisation In RailsInternationalisation In Rails
Internationalisation In Rails
 
Smart Internationalization assistance and resource translation tools
Smart Internationalization assistance and resource translation toolsSmart Internationalization assistance and resource translation tools
Smart Internationalization assistance and resource translation tools
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
 

Mehr von camp_drupal_ua

Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...camp_drupal_ua
 
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011camp_drupal_ua
 
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011camp_drupal_ua
 
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011camp_drupal_ua
 
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...camp_drupal_ua
 
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011camp_drupal_ua
 
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011camp_drupal_ua
 
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011camp_drupal_ua
 
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011camp_drupal_ua
 
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...camp_drupal_ua
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011camp_drupal_ua
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011camp_drupal_ua
 
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011camp_drupal_ua
 
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011camp_drupal_ua
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011camp_drupal_ua
 
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011camp_drupal_ua
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011camp_drupal_ua
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011camp_drupal_ua
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011camp_drupal_ua
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011camp_drupal_ua
 

Mehr von camp_drupal_ua (20)

Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...Peter Lozovitsky.Money under your feet or why you have not already training i...
Peter Lozovitsky.Money under your feet or why you have not already training i...
 
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
Dmitry Kostyuk.Cloud hosting for drupal.DrupalCamp Kyiv 2011
 
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
Pavel Makhrinsky.Field API.DrupalCamp Kyiv 2011
 
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
Vlad Savitsky.Modules parade.DrupalCamp Kyiv 2011
 
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
Vadim Mirgorod.Best practices for cross browser compatibility of drupal websi...
 
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
Sergey Korzh.CCK 3 presentation.DrupalCamp Kyiv 2011
 
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
Dennis Povshedny.Mediamosa intro.DrupalCamp Kyiv 2011
 
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
Artem Pankov.Eclipse.DrupalCamp Kyiv 2011
 
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
Vasily Yaremchuk.Single page website.DrupalCamp Kiev 2011
 
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
Anton Paschenko.Geolocation with Apach Solr using search API.DrupalCamp Kyiv ...
 
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
Sergei Stryukov.Drush.Why it should be used.DrupalCamp Kyiv 2011
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
Pavel Prischepa.node load without-restrictions.DrupalCamp Kiev 2011
 
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
Eugene Poltorakov.HTML 5 and drupal.DrupalCamp Kiev 2011
 
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
Anna Fedoruk.Theworkflow.DrupalCamp Kyiv 2011
 
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
Viktor Levandovsky.Why drupal.DrupalCamp Kyiv 2011
 
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
Petrov Olexandr.Varnish and drupal.DrupalCamp Kyiv 2011
 
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
 

Multilingual sites in Drupal 7: New features, new possibilities

  • 1. Multilingual sites in Drupal 7: New features, new possibilities Grigory Naumovets Kiev, Ukraine 1
  • 4. Outline 1. Support of multilingual content in Drupal: an overview 2. New multilingual features in D7 core 3. New multilingual features in D7 versions of contributed modules (i18n etc.) 4. Summary of most important improvements in multilingual functionality A5.Problems and prospects 2
  • 5. It’s a followup presentation to: Multilingual sites in Drupal: Problems, solutions, workarounds, and “goodness on the way” (DrupalCamp Kyiv 2009) www.slideshare.net/Tinnka/multilanguage-drupal gn.org.ua/drupal/presentations/DrupalCamp_2009-2010 2009 ----> 2011: • Has anything essential changed with the release of Drupal 7? • Is “multilingual goodness” already approaching, or still on the way? 3
  • 6. What is ”i18n” and ”L10n”? internationalization  i18n 18 letters omitted 10 letters omitted Localization  L10n These abbreviations are used in the names of Drupal modules, such as “i18n” or “L10n_client” 4
  • 7. If Drupal nodes were designed as multilingual from the very beginning… node/1 Title (lang1) Title (lang2) (multilingual) Body (lang1) Body (lang2) Some field (lang1) Some field (lang2) Another field (language-neutral) Some file attached (lang1) Some file attached (lang2) Another file attached (language-neutral) comments 5
  • 8. However, Drupal nodes are unilingual. i18n is an external feature. node/1 Title node/2 Title (unilingual) (unilingual) lang1 Body lang2 Body Some field Some field Another field Another field Some file attached Some file attached Another file attached Another file attached comments Drupal i18n system: I hereby declare node/1 comments and node/2 to be translations of each other 6
  • 9. Multilanguage: inside or outside? Two possible approaches to i18n: 1. Multilingual features inside an object 2. Unilingual object, multilanguage features are applied from outside as a system of connections to other objects “Object” can be a node, a block, a taxonomy term, a menu, a menu item, and so on. 7
  • 10. Inside vs outside • Drupal uses both approaches (depending on the object type), so improvements of multilang support proceed in two ways: – Making objects “more multilingual” – Improving the system of i18n-related connections between unilingual objects • Each approach has its advantages and difficulties • Until recently, approach to nodes was only “from outside” • Some problems caused by this approach will be demonstrated below 8
  • 11. No field-level language attributes: Why it can be a problem? Example 1 node/1 Title Title node/2 lang1 translation lang2 Body Body synchronization Image field Image field 9
  • 12. No field-level language attributes: Why it can be a problem? Example 2 node/3 (en) translation node/4 (ru) event info event info nodereference nodereference translation node/2 (ru) node/1 (en) location info location info You need to synchronize nodereferences (i18nsync) 10
  • 13. Problem with multilingual views based on nodereference en/events/by-location/ ru/events/by-location/ Events grouped by locations: Распределение событий по месту проведения: – Kiev (6) – Киев (6) – Chişinău (4) – Кишинёв (4) en  ru en/events/by-location/36 ru/events/by-location/37 List of events in Chişinău Список событий в Кишинёве en  ru “Chişinău” (node/36) and “Кишинёв” (node/37) are different nodes, so when you switch language EN -> RU while viewing the “List of events in Chişinău” you will see an empty list instead of “Список событий в Кишинёве”. 11
  • 14. Inside vs outside • However, the “outside” approach can have some advantages, too – It can be simpler to do or maintain – It can utilize such node-level things as access permissions for nodes having certain attributes (e.g. when you have different people working with nodes in different languages), and so on • It’s highly desirable to have both possibilities, and choose between them depending on the specific situation. 12
  • 15. Now, let us look at the D7 core • Modules included in D7 core (same as for D6): – Content Translation – Locale (disabled by default) 13
  • 16. Site configuration settings: “Regional and Language” section Available after enabling the “Locale” module 14
  • 17. Regional settings New in D7: • Now you can set “Default country” (to be used by contributed modules) • More intelligent time zone handling (with PHP 5.2+ DateTime objects) 15
  • 18. Date and time settings • More control over date and time format 16
  • 19. Configuration of Languages: Detection and selection New in D7: • Finer control over language detection and selection • We can set order of priorities 17
  • 20. Interface translation New in D7: • Improved user interface • Support for context 18
  • 21. Contexts are intended for per-meaning translatability Context: “May” as Long month name (not “may be”) Context is a new feature; guidelines still need to be developed. So far, used inconsistently. Not supported by Javascript menu items and strings. 19
  • 22. Localization auto-update • Localization update module by Jose Reyero (L10n_update) • Works similarly to Drupal core update module • Downloads translation updates from localize.drupal.org (or from custom depository) • Available both for D7 and D6 (v. 7.x-1.0-beta2 and 6.x-1.0-beta1 of 2011-May-31) 20
  • 23. “Cheat sheets” for localizers (“шпаргалки”) • Drupal 7 localization cheat sheet Drupal 6 localization cheat sheet by Gábor Hojtsy hojtsy.hu/files/Drupal7TranslationCheatSheetv2.pdf hojtsy.hu/files/Drupal6TranslationCheatSheetv2.pdf 21
  • 24. Now about content translation Enable multilingual support in content type properties: Looking for this in “Publishing options” is not really obvious 22
  • 25. Now we can control ‘node.language’ attribute for nodes of this content type • By default, a new node is Language neutral New in D7: For language-neutral nodes, database field node.language = ‘und’ ‘und’ means ‘undetermined’ in compliance with ISO 639 23
  • 26. Node translation (same as in D6) “Translate” tab is seen when: 1. This content type has multilingual support “Enabled, with translation” 2. This node is NOT language neutral 3. User is permitted to translate content 24
  • 27. “Translation set” (same as in D6) node/1 node/2 Base node Translated node node.nid=1 node.nid=2 node.language=‘en’ node.language=‘uk’ node.tnid=1 node.tnid=1 node/3 Translated node ‘tnid’ – translation set id node.nid=3 is shared by all nodes in a node.language=‘ru’ translation set node.tnid=1 is equal to ‘nid’ of the base node 25
  • 28. And now something really new… D7 core has built-in support for field  languages!!! (via its new Field API) However, D7 has NO built-in interface for  translatable fields We need to use some contributed modules 26
  • 29. Entity_translation module Can be used to translate fields New item in “Regional and language settings” – “Entity translation” 27
  • 30. Entity translation New option for multilingual support in content type properties Field settings: “Users may translate this field” 28
  • 31. Single node with multilingual body and other fields: wow, it [almost] works! example.com/node/1 example.com/uk/node/1 Node title is a different kind of field and cannot be translated this way!!! 29
  • 32. ‘Title’ module: replace node title with a regular field 30
  • 33. Single node with multilingual body and other fields: now the title can be translated, too! example.com/node/1 example.com/uk/node/1 Node title is now replaced with a regular field using ‘Title’ module 31
  • 34. Entity_translation + Title: is this already the “multilingual field goodness”? • These modules are very recent, still at the ‘dev’ stage (v. 7.x-1.x-dev) • As of June 2, 2011, – 130 sites currently report using ‘Entity_translation’ – 59 sites currently report using ‘Title’ • Still quite a lot of todo’s • We need to test its interactions with views. taxonomy, paths, and so on. 32
  • 35. Now about the i18n.module – Q: Can I build a multilingual site using only the core D7 functionality? – A: A very simple site – yes, but for more complex things you’ll need the i18n.module. i18n helps you handle multilingual blocks, menus, views, synchronization of items between nodes, and so on. 33
  • 36. Enabling multilingual variables in i18n/D6: add their names (site_name, site_footer, theme_settings, etc.) to the settings.php file $conf['i18n_variables'] = array( // Site name, slogan, mission, etc.. 'site_name', 'site_slogan', 'site_mission', 'site_footer', 'anonymous', // Different front page for each language 'site_frontpage', // Primary and secondary links 'menu_primary_links_source', 'menu_secondary_links_source', // Contact form information 'contact_form_information', // For theme variables, read more below 'theme_settings', 'theme_garland_settings', ); 34
  • 37. i18n/D7 does not work this way anymore Now multilingual variables are controlled via “Multilingial settings – Variables” menu (Depends on the new variable.module) 35
  • 38. Multilingual variables A very convenient link to switch languages (especially if there is no language switcher in the admin theme) 36
  • 39. New in D7 and important: Translation set API (i18n_translation.module) • Now we can create translation sets not only for nodes, but for other things, too: – taxonomy terms – menu items – paths • Not implemented yet for blocks 37
  • 40. Taxonomy terms Connect different terms as translations of each other: This option was available in D6, too – but it did not really work. Now (I hope) it should! 38
  • 41. New: Path translation (i18n_path.module) • Intended for translation of generic paths that don't have other way of being translated. • From any of these pages, the language switcher will point to the other path for each language. • Note: path translations must be defined without aliases. 39
  • 42. Menu translation • Thanks to Translation set API, now we can translate menu items pointing to specific nodes, e.g.: (en) -> node/1 (uk) -> node/2 40
  • 43. Blocks • Translation sets not working for Blocks yet(?) • Improved UI and visibility options • Block can be translated via string translation 41
  • 44. Other improvements in i18n • More options and improved UI for content selection and filtering by language • More items can be synchronized between translation set nodes (because more items are available as Fields) • Translation redirect (i18n_redirect.module): redirect to translated path when available (SEO optimization) • Contact form translation (i18n_contact.module) – recently added 42
  • 45. Berlin Internationalization sprint (May 11-15, 2011) • i18nsprint.drupalevents.de • reyero.net/en/drupal/berlin_internationalization_ sprint: “How i18n got some fresh blood and a sexy facelift” • i18n 7.x-1.0-beta6 (May 24, 2011) includes improvements from Berlin i18n sprint. New features: – Consistent translation tabs for objects – Contact form translation 43
  • 46. Summary of most important changes in D7 and i18n/D7 • D7: – Translation of fields within a node (no built-in UI yet, available via recently contributed modules) • i18n/D7: – Translation sets (connecting taxonomy terms, menu items, paths, etc.) • Plus lots of less important improvements in UI, content selection and filtering, etc. 44
  • 47. References • Drupal 7's new multilingual systems compilation by Gábor Hojtsy hojtsy.hu/multilingual-drupal7 • Drupal 7 Multilingual: What is new in i18n by Suzanne Kennedy evolvingweb.ca/story/drupal-7-multilingual-whats-new-i18n • Multilanguage for Drupal 7: Internationalization module (i18n beta1) by Jose Reyero reyero.net/en/drupal/drupal7_i18n_beta1_overview • Content Translation (field translation) in Drupal 7: First steps by Randy Fay (read discussions in the comments, too!) randyfay.com/node/88 45
  • 48. Questions? Contacts:  http://camp11.drupal.ua/users/GN  gnaumovets@gmail.com  http://gn.org.ua/feedback 46