Download - Barcelona Multilanguage
![Page 1: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/1.jpg)
Multilingual Drupalfrom 5 to 6
Gábor HojtsySeptember 19., 2007.
![Page 2: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/2.jpg)
About me
• Working with Open Source since 1999, was head of PHP.net and the PHP documentation
• Developing with Drupal since 2003, multiple contributed modules, Hungarian translations
• Drupal 6 core committer
![Page 3: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/3.jpg)
About you
• Experienced Drupal site builders?
• Who deals with multilingual issues?
• Knowledge in both areas?
![Page 4: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/4.jpg)
Concepts
![Page 5: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/5.jpg)
Your target audience• A multilingual web site is available
in multiple languages. It is not necessarily an international one.
• An international web site is intended to be used internationally. It is not necessarily a multilingual one.
![Page 6: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/6.jpg)
Two terms
Internationalization (i18n) is the design and development of a product, application or document content that enables easy localization for target groups that vary in culture, region or language (locale).
![Page 7: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/7.jpg)
Two terms
Localization (L10n) is the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (locale).
![Page 8: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/8.jpg)
Confusions
i18n L10n
multilingual international
![Page 9: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/9.jpg)
Drupal
![Page 10: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/10.jpg)
Drupal “by design”
• There is the built in interface, which is always served from code
• You provide everything else (posts, menu items, admin defined blocks, and so on)
![Page 11: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/11.jpg)
Famous issues
๏ Default content type names are not translated
๏ Built-in, but modified menu items are neither
๏ The “Forums” vocabulary title is not translated
![Page 12: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/12.jpg)
Drupal 5
![Page 13: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/13.jpg)
Built into Drupal 5
• Translatable installer
• Basic interface language list setup
• Runtime interface translation with per user preferences
![Page 14: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/14.jpg)
How does it work?
• GNU gettext backend and format used
• Translation templates extracted from source code
• CVS used to store/release translations
• User imports translation files in Drupal (which stores them in the DB)
![Page 15: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/15.jpg)
Recognize the source
• t(‘Go to %page’, array(‘%page’ => $p));
• format_plural($count, ‘1 year’, ‘@count years’);
• Several special cases: permissions, watchdog type names, and so on
![Page 16: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/16.jpg)
Contributed modules
• Autolocale / localized profile
• Internationalization module suite
• Localizer module suite
• XLIFF tools
![Page 17: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/17.jpg)
Computer Aided Translation
![Page 18: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/18.jpg)
Outside Drupal
• Content translation works in Drupal
• But professionals use different tools
• Translation memories
• Automated translation
• Professional content review
![Page 19: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/19.jpg)
CAT workflow
![Page 20: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/20.jpg)
Drupal implementation
![Page 21: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/21.jpg)
Demo
![Page 22: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/22.jpg)
Drupal 6
![Page 23: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/23.jpg)
Drupal 6 goes forward!
• New language subsystem
• Easy interface translation import
• Performance optimizations
• Content translation
• Textgroups API
![Page 24: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/24.jpg)
Drupal 6 architecture
This was not ready on time, so it
is not included.
![Page 25: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/25.jpg)
Languages!
• English and native language names
• Writing direction (LTR or RTL)
• Weights
• Path prefix and subdomain setup and recognition
![Page 26: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/26.jpg)
Right to left themes
• All CSS file additions are intercepted and RTL cascade files are searched for
• Most core themes have RTL support, full support expected in final release
![Page 27: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/27.jpg)
Language detection
• Based on the IRI (domain, path)
• User preferences
• Browser settings
• Falls back on site default
![Page 28: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/28.jpg)
Automated import
• Friendlier translation package format
• Batch API for tasks to run in multiple HTTP requests
• Install time import of interface translations
• Module/theme changes result in translation imports
![Page 29: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/29.jpg)
Translatable JavaScript
• Drupal.t() and Drupal.formatPlural() to translate strings in JavaScript
• Works with on the fly string collection or preprocessing
• Also brings simple theming to JavaScript
![Page 30: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/30.jpg)
Text groups API
• Multiple text groups possible to translate user defined content
• This remains a programming API for Drupal 6, not used in the core system
![Page 31: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/31.jpg)
On-page interface translation
• Ability to collect all strings used to build the page
• Try localization client module for Drupal 6!
• Also useful for by-site optimization
![Page 32: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/32.jpg)
Content language
• Any post can have a language associated, or can be neutral
• This is configurable per content type
• Does not mean content translation
![Page 33: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/33.jpg)
Content translation
• Posts can be associated with each other, organized into translation sets
• Basic workflow supported to check for outdated translations
• Translation links, language switcher block
• Simple API for content/field types
![Page 34: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/34.jpg)
Per-language aliases
• Path aliases can be language dependent
• Still fall back to default alias, if no specific alias defined
• Examples: ‘home’, ‘honlap’, ‘inicio’
![Page 35: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/35.jpg)
Lower level changes
• Multilingual request handling made possible
• Emails are sent in the language of the user targeted (API also changed a lot)
• Log messages are stored in English, localized on display
![Page 36: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/36.jpg)
More for hard-core people
• Modify some site interface strings by adding an array to settings.php
• No need for locale module, could be used to customize English sites
![Page 37: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/37.jpg)
Still no way to translate
• Site settings
• Categories
• User defined menus
• Aggregator categories
• Profile field titles and category names
• Content type properties
![Page 38: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/38.jpg)
Contributed modules
• i18n and localizer is here to stay
• Many more contributed modules can/should use the enhancements
![Page 39: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/39.jpg)
And still...
There is a lot more to love in Drupal 6(You will hear about these a lot)
![Page 40: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/40.jpg)
New kid on the block
![Page 41: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/41.jpg)
Localization server
• Making interface translation for language groups a lot easier
• We are moving from CVS and project management to a web application
• Translation sharing, support for the new packaging format
• My presentation: 14h, Sun room
![Page 42: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/42.jpg)
Try Drupal 6!
• Drupal 6 beta 1:http://drupal.org/drupal-6.0-beta1
• Nightly development snapshot:http://drupal.org/node/97368
• Report bugs at http://drupal.org/node/add/project_issue/drupal/bug
![Page 43: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/43.jpg)
Read the thesis
• http://hojtsy.hu/files/GaborHojtsyThesis.pdf
• A summary of i18n related problems
• How Drupal 5, Joomla 1.0, TYPO3 4.1 and Plone approach these problems
• Planning of the Drupal 6 solutions
• Not everything ended up implemented as documented there
![Page 44: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/44.jpg)
Sponsored by
• Development Seed (infrastructure, Jose A. Reyero)
• Google Summer of Code (localization tools for Drupal 6)
![Page 45: Barcelona Multilanguage](https://reader033.vdocuments.site/reader033/viewer/2022052410/5552f229b4c90584028b4b9e/html5/thumbnails/45.jpg)
Thanks!
All photos included made by myself in Hungary, Bonn and Sankt Augustin.