Metadata-Version: 1.0
Name: z3c.language.session
Version: 1.0.1
Summary: Zope3 i18n language session.
Home-page: http://pypi.python.org/pypi/z3c.language.session
Author: Roger Ineichen and the Zope Community
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package provides a session which can be used to store a language. See
        z3c.language.negotiator for a sample usage.
        
        
        Detailed Documentation
        **********************
        
        =================================
        Session-based Language Preference
        =================================
        
        The package provides a simple access to a session for store a language.
        
        >>> from zope.session.interfaces import ISession
        >>> from zope.session.session import PersistentSessionDataContainer
        >>> from zope.session import tests
        >>> from z3c.language.session import interfaces
        >>> from z3c.language.session import app
        
        We have to setup a session data container and create a test request:
        
        >>> request = tests.setUp(PersistentSessionDataContainer)
        
        We can simply create a session with the request as attribute:
        
        >>> langSession = app.LanguageSession(request)
        
        Such a session provides the `ILanguageSession` interface:
        
        >>> interfaces.ILanguageSession.providedBy(langSession)
        True
        
        And the base `ISession` interface:
        
        >>> ISession.providedBy(langSession)
        True
        
        
        ``getLanguage()`` Method
        ------------------------
        
        We can check if there is a language set in the session with
        ``getLanguage()``. If no language is set, it should be ``None``:
        
        >>> langSession.getLanguage()
        
        
        ``setLanguage()`` Method
        ------------------------
        
        The session provides ``setLanguage()`` which can set a language:
        
        >>> langSession.setLanguage('de')
        
        Now we should get the new language stored in the session:
        
        >>> langSession.getLanguage()
        'de'
        
        
        =======
        CHANGES
        =======
        
        1.0.1 (2008-01-24)
        ------------------
        
        - Bug: Improve meta-data and documentation.
        
        
        1.0.0 (2008-01-21)
        ------------------
        
        - Initial Release
        
Keywords: zope3 z3c i18n language session
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
