1 / 22

Translating Drupal Websites

Translating Drupal Websites. Sean Burlington www.PracticalWeb.co.uk Quick run through Translation generally Lessons learned Drupal specifics String translation Page translation. A long Time ago. Nictotinell.com. Project developed in custom PHP Design first Then functionality

sahkyo
Download Presentation

Translating Drupal Websites

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Translating Drupal Websites • Sean Burlington • www.PracticalWeb.co.uk • Quick run through • Translation generally • Lessons learned • Drupal specifics • String translation • Page translation

  2. A long Time ago ...

  3. Nictotinell.com • Project developed in custom PHP • Design first • Then functionality • Lastly translation

  4. What I learned then • Norwegian words are really long.. • Text gifs, layout tables, and translations !@#!* • Don't take shortcuts • Good Practice pays off • Balance the tags in every template • Don't let translation be an afterthought

  5. Still before Drupal

  6. How it worked • Custom “CMS” • 2 languages English/Welsh • script.aculo.us • In place editing • Suprising how may 'odd' pages crop up

  7. www.useyourpaths.info

  8. Complex Pages • Long forms • Lots of little bits of text • The in-place editing really helped for long forms • No support calls :-)‏

  9. (version 5)‏ Drupal

  10. Manage Strings

  11. Locale Module (core)‏ • Enhances the t function • Make sure everyone readshttp://api.drupal.org/api/function/t/5 • Choose a standard • Does it include trailing spaces? • What about punctuation? • Avoid t($text) – use t('literal text')

  12. format_plural()‏ • 1 item – 2 items format_plural($feed->items, '1 item', '@count items')‏ • Calls t() internally

  13. Problems with Manage Strings • Strings originally in code – but translated from database • String only available for translation afterit has been displayed • Hard to find strings • What about error messages • How do you know when you're finished • How to test a translation

  14. Solution • Potx – extracts strings from t functionsAllows you to select by module • http://translate.sourceforge.net/wiki/toolkit/csv2po • But this gives admin and public text together • We wrote an upload languages module (I'm trying to GPL this)‏ • This takes a CSV of all languages – and returns a merged CSV including any new translations • Useful for deployment

  15. Localizer Module

  16. Lots of options

  17. Localizernode • Works with custom node types • Just implement the usual hooks(_insert, _update, _delete)‏ • Creates a “Translation set” of nodes from the original node

  18. Translations tab

  19. What it does • Creates new nodes that are translations of existing ones • Maintains a lookup table • Automatically displays the users preferred translation • It works nicely • But – we had nodes that referred to other nodes on another site via a CCK field and SOAP ... • Make sure everyone knows about the lookup table at an early stage !

  20. In General • Plan • Check your design • Introduce standards early • Test dummy translations early • Translate late

More Related