Plone i18n, LinguaPlone

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Plone i18n, LinguaPlone - Presentation Transcript

      • Plone i18n, LinguaPlone
        • Vitaliy Podoba, Developer
        • © Quintagroup, 2008
    1. Zope/Plone i18n
    2. Table of contents
      • History intro
      • Packages which influence i18n
      • Howto translate your package
      • Questions/Answers
    3. History intro
      • No i18n
      • ZBabel
      • Localizer
      • PlacelessTranslationService
      • I18NLayer
      • I18NFolder
      • PloneLanguageTool
      • LinguaPlone
    4. i18n packages
      • zope.i18n, zope.i18nmessageid
      • zope.app.i18n
      • Five
      • PlacelessTranslationservice
      • plone.i18n
      • plone.app.i18n
      • PloneTranslations
      • PloneLanguageTool
      • CMPPlone
    5. Addon translation
      • Keep your code translatable:
      • Addon translation domain
      • Page Template translation
      • Python code translation
      • GS profile translation
      • Translation files
    6. Translation domain
      • from zope.i18nmessageid import MessageFactory
      • PloneMessageFactory = MessageFactory('plone')
    7. 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>
      • <p i18n:translate=&quot;msg_id&quot;>Welcome to Plone.</p>
      • <p i18n:translate=&quot;&quot;>Welcome to Plone.</p>
      • <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;>
      • <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.
    8. 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'})
      • ts = getToolByName(context, 'translation_service')
      • return ts.translate('domain',
      • 'msgid',
      • context,
      • {'date':'2008-08-08'},
      • target_language='en',
      • default='Default message')
    9. GS Profile Translation
      • See Page Template Translation section
    10. Translation files
    11. Translation Tools
        • I18ndude
        • i18nextract.py
        • PloneTranslations utils
        • poEdit
      • i18ndude rebuild-pot --pot locales/mydomain.pot --create mydomain .
      • i18ndude sync --pot locales/mydomain.pot locales/*/LC_MESSAGES/mydomain.po
      i18ndude
      • #. 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
    12. 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
    13. Register translation
      • <configure
      • xmlns:i18n=&quot;http://namespaces.zope.org/i18n&quot;>
      • <i18n:registerTranslations directory=&quot;locales&quot; />
      • </configure>
    14. Questions/Answers
    15. LinguaPlone
    16. Table of contents
      • LinguaPlone Features
      • UI
      • LinguaPlone Internals
      • Questions/Answers
    17. 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
    18. 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
    19. UI
      • Languages Control Panel
      • 'Translate into' pulldown menu
      • Translation Form
      • Manage Translations Form
      • Language Selector Viewlet
      • Language Portlet
    20. Languages Configlet
    21. Translate into menu
    22. Translation Form
    23. Translation Form
    24. Manage Translations Form
    25. Manage Translations Form
    26. Language Selector Viewlet
    27. Language Portlet
    28. Internals
      • Patches: publisher, catalog, kupu
      • LanguageIndex: Language
      • languageIndependent=True
      • AT references: translationOf
      • Delete protection, off by default
      • Translation id: <orig_id>-lang_code
    29. Multilingual support for your content types
      • try:
      • from Products.LinguaPlone.public import *
      • except ImportError:
      • # No multilingual support
      • from Products.Archetypes.public import *
    30. Questions/Answers
    31. The End

    + QuintagroupQuintagroup, 2 years ago

    custom

    1158 views, 1 favs, 1 embeds more stats

    History intro, Packages which influence i18n, How more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1158
      • 1153 on SlideShare
      • 5 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 5
    Most viewed embeds
    • 5 views on http://www.plug.org.ua

    more

    All embeds
    • 5 views on http://www.plug.org.ua

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories