Translating Drupal
  (the new way)
       Gábor Hojtsy
   September 19., 2007.
Sponsored by

 All of my work explained in
this session was sponsored by
Google Summer of Code 2007.

      Thanks Google!
About me

• Using and contributing to Drupal
  since 2003
• Multiple modules, Hungarian
  translations
• Drupal 6 core com...
About you


• Users of existing translations?
• Translating in-house modules?
• Occasional translation contributors?
• Mem...
Setting the topic
Translating Drupal


• Translate the built-in interface
• User provided content translation is
  out of scope here (sessio...
History
t() is born
          January 22, 2001

     <?

     function t($string) {
       return $string;
     }

     ?>

(forma...
Timeline
• Jan 22, 2001 - t()
• Feb 12, 2001 - Locale module
• Feb 17, 2001 - Basic Translation
  interface, the strikethr...
Timeline

various smaller updates before I start
     watching Formula 1 with [a] a
  0.5 liter box of Haagen-Dhaz (Belgia...
Timeline

• Jul 24, 2001 - Search form, even
   module filtering, thanks to:
quot;location LIKE '%module.php?mod=quot;. che...
Timeline

• Sept 11, 2003 - Extractor.php is born
• Dec 28, 2003 - Short string cache
• Aug 11, 2004 - Gettext format base...
Timeline

• Sep 1, 2006 - Translatable installer
• Mar 26, 2007 - New language system
• May 15-22, 2007 - Automated
  tran...
How does it work?
Translate in PHP

• t(‘Go to %page’, array(‘%page’ => $p));
• format_plural($count, ‘1 year’,
  ‘@count years’);
• Several...
Original process

• t() stores new strings for translation,
  when called with unknown text
• Web interface to translate
•...
Collaborative process

• A preprocessor generates translation
  templates
• Translators grab templates and
  translate
• P...
Translate in JavaScript


• Drupal.t() and Drupal.formatPlural()
  to translate strings in JavaScript
• Works just as well...
Drupal core process
Drupal contrib process
Still too hard
• Know CVS
• Have write permissions
• Use gettext tools to merge and translate
• Time releases properly
• T...
Translation packages

• http://drupal.org/project/Translations
• Contributed project translations
  scattered all around t...
Usability problems


• Although users upload and install
  modules, they need to upload
  translations on the web separate...
Executive summary:
 Pain for translators
    Pain for users
Better for users in
    Drupal 6
Locale automation

• Language selection at start of installer
• Fully localized installer, imports
  translations for all ...
In need of a cleanup


• Unfortunately we don’t know what to
  remove when a module is disabled or
  uninstalled

• This i...
New packaging format

• All these changes required a new
  packaging format
• Based on more smaller files in a well
  define...
New packaging format
Also better for
onsite translators
   in Drupal 6
On-page translation

• Drupl 6 changes made on-page
  translation possible

• Served with the l10n_client
  contributed mo...
Demo
What about
collaboration?
Simplifying our lives

• Drupal.org knows about all the
  projects and releases available

• Their source code can be pars...
Localization server

• In part based on ideas from
  Bruno Massa
• Maintains a list of projects and
  releases
• Parses so...
Localization community

• Translation community interface,
  based on organic groups
• Collaborate on project translations...
New process

• Have seen groups.drupal.org?
• Translation groups, two permission
  levels: open and controlled

• Can host...
New process

• Projects and releases are
  automatically available

• Translations can be imported from PO
  file, exported...
Demo
So when will this go live?

• Hopefully before or around the
  Drupal 6 release
• There are still features to implement
  ...
Thanks!
Upcoming SlideShare
Loading in...5
×

Translating Drupal

5,881

Published on

http://barcelona2007.drupalcon.org/node/430

Published in: Technology, Business
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,881
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
108
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Translating Drupal

  1. 1. Translating Drupal (the new way) Gábor Hojtsy September 19., 2007.
  2. 2. Sponsored by All of my work explained in this session was sponsored by Google Summer of Code 2007. Thanks Google!
  3. 3. About me • Using and contributing to Drupal since 2003 • Multiple modules, Hungarian translations • Drupal 6 core committer • Locale module maintainer
  4. 4. About you • Users of existing translations? • Translating in-house modules? • Occasional translation contributors? • Members of official translation teams?
  5. 5. Setting the topic
  6. 6. Translating Drupal • Translate the built-in interface • User provided content translation is out of scope here (sessions about this topic were before lunch)
  7. 7. History
  8. 8. t() is born January 22, 2001 <? function t($string) { return $string; } ?> (format_plural() was there earlier)
  9. 9. Timeline • Jan 22, 2001 - t() • Feb 12, 2001 - Locale module • Feb 17, 2001 - Basic Translation interface, the strikethrough overview, languages added by SQL DDL
  10. 10. Timeline various smaller updates before I start watching Formula 1 with [a] a 0.5 liter box of Haagen-Dhaz (Belgian Choclate) and [b] my laptop on my lap for drupal hacking. Life hardly can get any better than this. Commit comment by Dries for locale.inc 1.7
  11. 11. Timeline • Jul 24, 2001 - Search form, even module filtering, thanks to: quot;location LIKE '%module.php?mod=quot;. check_input($edit[module]) .quot;%'quot; • Jan 5, 2002 - Locale cache • June 2, 2003 - Module filtering removed, due to URL restructuring
  12. 12. Timeline • Sept 11, 2003 - Extractor.php is born • Dec 28, 2003 - Short string cache • Aug 11, 2004 - Gettext format based string sharing, web administration, plural formulas • Aug 18, 2006 - @ and ! placeholders
  13. 13. Timeline • Sep 1, 2006 - Translatable installer • Mar 26, 2007 - New language system • May 15-22, 2007 - Automated translation import • Jun 8, 2007 - JavaScript translation
  14. 14. How does it work?
  15. 15. Translate in PHP • t(‘Go to %page’, array(‘%page’ => $p)); • format_plural($count, ‘1 year’, ‘@count years’); • Several special cases: permissions, watchdog type names, and so on
  16. 16. Original process • t() stores new strings for translation, when called with unknown text • Web interface to translate • Different sharing methods through the years: SQL, Gettext
  17. 17. Collaborative process • A preprocessor generates translation templates • Translators grab templates and translate • Package is distributed • Users import the translations
  18. 18. Translate in JavaScript • Drupal.t() and Drupal.formatPlural() to translate strings in JavaScript • Works just as well with on the fly string collection or preprocessing
  19. 19. Drupal core process
  20. 20. Drupal contrib process
  21. 21. Still too hard • Know CVS • Have write permissions • Use gettext tools to merge and translate • Time releases properly • Track project progress and goals • Reuse translations as you can
  22. 22. Translation packages • http://drupal.org/project/Translations • Contributed project translations scattered all around the repository • Some teams even have their own download locations
  23. 23. Usability problems • Although users upload and install modules, they need to upload translations on the web separately • Existing translations can be broken by new uploads
  24. 24. Executive summary: Pain for translators Pain for users
  25. 25. Better for users in Drupal 6
  26. 26. Locale automation • Language selection at start of installer • Fully localized installer, imports translations for all enabled modules • Automated import when • new language is added • module is installed • theme is enabled
  27. 27. In need of a cleanup • Unfortunately we don’t know what to remove when a module is disabled or uninstalled • This is solved in part by version tracking in locale module
  28. 28. New packaging format • All these changes required a new packaging format • Based on more smaller files in a well defined directory structure • ‘po’ renamed to ‘translations’ • Now also used with core modules
  29. 29. New packaging format
  30. 30. Also better for onsite translators in Drupal 6
  31. 31. On-page translation • Drupl 6 changes made on-page translation possible • Served with the l10n_client contributed module • Interface still to be refined (a lot)
  32. 32. Demo
  33. 33. What about collaboration?
  34. 34. Simplifying our lives • Drupal.org knows about all the projects and releases available • Their source code can be parsed for translatables • Can be automated - we can even inform module developers about errors found
  35. 35. Localization server • In part based on ideas from Bruno Massa • Maintains a list of projects and releases • Parses source packages for translatables
  36. 36. Localization community • Translation community interface, based on organic groups • Collaborate on project translations • Different permission levels • Import/export with Gettext support
  37. 37. New process • Have seen groups.drupal.org? • Translation groups, two permission levels: open and controlled • Can host discussions, debates, “vocabularies”, “dictionaries”
  38. 38. New process • Projects and releases are automatically available • Translations can be imported from PO file, exported in PO packages • Web based editing on custom interface • TODO: backwards connection with projects
  39. 39. Demo
  40. 40. So when will this go live? • Hopefully before or around the Drupal 6 release • There are still features to implement and perfect • It needs to fit nicely into the drupal.org infrastructure
  41. 41. Thanks!
  1. A particular slide catching your eye?

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

×