Your SlideShare is downloading. ×
Plone i18n, LinguaPlone
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Plone i18n, LinguaPlone

2,580
views

Published on

History intro, Packages which influence i18n, How to translate your package

History intro, Packages which influence i18n, How to translate your package

Published in: Technology, Business

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,580
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1.
    • Plone i18n, LinguaPlone
      • Vitaliy Podoba, Developer
      • © Quintagroup, 2008
  • 2. Zope/Plone i18n
  • 3. Table of contents
    • History intro
    • Packages which influence i18n
    • Howto translate your package
    • Questions/Answers
  • 4. History intro
    • No i18n
    • ZBabel
    • Localizer
    • PlacelessTranslationService
    • I18NLayer
    • I18NFolder
    • PloneLanguageTool
    • LinguaPlone
  • 5. i18n packages
    • zope.i18n, zope.i18nmessageid
    • zope.app.i18n
    • Five
    • PlacelessTranslationservice
    • plone.i18n
    • plone.app.i18n
    • PloneTranslations
    • PloneLanguageTool
    • CMPPlone
  • 6. Addon translation
    • Keep your code translatable:
    • Addon translation domain
    • Page Template translation
    • Python code translation
    • GS profile translation
    • Translation files
  • 7. Translation domain
    • from zope.i18nmessageid import MessageFactory
    • PloneMessageFactory = MessageFactory('plone')
  • 8. Page Template translation
    • <html ...
    • xmlns:i18n=&quot; http://xml.zope.org/namespaces/i18n &quot;
    • i18n:domain=&quot;plone&quot;>
    • ...
    • <div i18n:domain=&quot;some.other.domain&quot;>...</div>
    • ...
    • </html>
  • 9.
    • <p i18n:translate=&quot;msg_id&quot;>Welcome to Plone.</p>
    • <p i18n:translate=&quot;&quot;>Welcome to Plone.</p>
  • 10.
    • <img src=&quot;plone.gif&quot;
    • alt=&quot;Plone Icon&quot;
    • title=&quot;Plone Icon Title&quot;
    • i18n:attributes=&quot;alt title&quot;>
    • <img src=&quot;plone.gif&quot;
    • alt=&quot;Plone Icon&quot;
    • title=&quot;Plone Icon Title&quot;
    • i18n:attributes=&quot;alt plone-icon;
    • title plone-icon-title&quot;>
  • 11.
    • <p i18n:translate=&quot;&quot;>There have been over
    • <span tal:content=&quot;here/download_count&quot;
    • i18n:name=&quot;count&quot;>100,000</span>
    • downloads of Plone.
    • </p>
    There have been ${count} downloads of Plone.
  • 12. Python code translation
    • from Products.CMFPlone import PloneMessageFactory as _
    • return _(u&quot;Welcome to Plone&quot;)
    • from Products.CMFPlone import PloneMessageFactory as _
    • return _(u&quot;welcome_to_plone&quot;,
    • default=&quot;Welcome to Plone, ${date}&quot;,
    • mapping={'date':'2008-08-08'})
  • 13.
    • ts = getToolByName(context, 'translation_service')
    • return ts.translate('domain',
    • 'msgid',
    • context,
    • {'date':'2008-08-08'},
    • target_language='en',
    • default='Default message')
  • 14. GS Profile Translation
    • See Page Template Translation section
  • 15. Translation files
  • 16. Translation Tools
      • I18ndude
      • i18nextract.py
      • PloneTranslations utils
      • poEdit
  • 17.
    • i18ndude rebuild-pot --pot locales/mydomain.pot --create mydomain .
    • i18ndude sync --pot locales/mydomain.pot locales/*/LC_MESSAGES/mydomain.po
    i18ndude
  • 18.
    • #. Default: &quot;Site News&quot;
    • msgid &quot;news-description&quot;
    • msgstr &quot;&quot;
    • #. Default: &quot;Events&quot;
    • msgid &quot;events-title&quot;
    • msgstr &quot;&quot;
    POT Example
  • 19. Compile po files
    • # Compile po files
    • for lang in $(find locales -mindepth 1 -maxdepth 1 -type d); do
    • if test -d $lang/LC_MESSAGES; then
    • msgfmt -o $lang/LC_MESSAGES/${PRODUCTNAME}.mo $lang/LC_MESSAGES/${PRODUCTNAME}.po
    • fi
    • done
  • 20. Register translation
    • <configure
    • xmlns:i18n=&quot;http://namespaces.zope.org/i18n&quot;>
    • <i18n:registerTranslations directory=&quot;locales&quot; />
    • </configure>
  • 21. Questions/Answers
  • 22. LinguaPlone
  • 23. Table of contents
    • LinguaPlone Features
    • UI
    • LinguaPlone Internals
    • Questions/Answers
  • 24. Features
    • Totally transparent, install-and-go
    • Each translation is a discrete object, and can be workflowed individually
    • Translations are kept track of using AT references
    • Even if you uninstall LinguaPlone after adding multilingual content, all your content will be intact and will work as separate objects
  • 25. Features
    • Supporting multilingual capabilities is a 4 (!) line addition to your Archetypes class
    • Fully integrated with ATContentTypes, so the basic content types are translatable
    • Supports language-independent fields
    • Uses the notion of Canonical versions
    • LinguaPlone doesn't require a particular hierarchy of content
  • 26. UI
    • Languages Control Panel
    • 'Translate into' pulldown menu
    • Translation Form
    • Manage Translations Form
    • Language Selector Viewlet
    • Language Portlet
  • 27. Languages Configlet
  • 28. Translate into menu
  • 29. Translation Form
  • 30. Translation Form
  • 31. Manage Translations Form
  • 32. Manage Translations Form
  • 33. Language Selector Viewlet
  • 34. Language Portlet
  • 35. Internals
    • Patches: publisher, catalog, kupu
    • LanguageIndex: Language
    • languageIndependent=True
    • AT references: translationOf
    • Delete protection, off by default
    • Translation id: <orig_id>-lang_code
  • 36. Multilingual support for your content types
    • try:
    • from Products.LinguaPlone.public import *
    • except ImportError:
    • # No multilingual support
    • from Products.Archetypes.public import *
  • 37. Questions/Answers
  • 38. The End