Mercurial > p > roundup > code
comparison roundup/cgi/TAL/TranslationContext.py @ 2348:8c2402a78bb0
beginning getting ZPT up to date: TAL first
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 21 May 2004 05:36:30 +0000 |
| parents | |
| children | 6e3e4f24c753 |
comparison
equal
deleted
inserted
replaced
| 2347:fbbda3b1816d | 2348:8c2402a78bb0 |
|---|---|
| 1 ############################################################################## | |
| 2 # | |
| 3 # Copyright (c) 2001, 2002 Zope Corporation and Contributors. | |
| 4 # All Rights Reserved. | |
| 5 # | |
| 6 # This software is subject to the provisions of the Zope Public License, | |
| 7 # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. | |
| 8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | |
| 9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 10 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | |
| 11 # FOR A PARTICULAR PURPOSE. | |
| 12 # | |
| 13 ############################################################################## | |
| 14 """Translation context object for the TALInterpreter's I18N support. | |
| 15 | |
| 16 The translation context provides a container for the information | |
| 17 needed to perform translation of a marked string from a page template. | |
| 18 | |
| 19 $Id: TranslationContext.py,v 1.1 2004-05-21 05:36:30 richard Exp $ | |
| 20 """ | |
| 21 | |
| 22 DEFAULT_DOMAIN = "default" | |
| 23 | |
| 24 class TranslationContext: | |
| 25 """Information about the I18N settings of a TAL processor.""" | |
| 26 | |
| 27 def __init__(self, parent=None, domain=None, target=None, source=None): | |
| 28 if parent: | |
| 29 if not domain: | |
| 30 domain = parent.domain | |
| 31 if not target: | |
| 32 target = parent.target | |
| 33 if not source: | |
| 34 source = parent.source | |
| 35 elif domain is None: | |
| 36 domain = DEFAULT_DOMAIN | |
| 37 | |
| 38 self.parent = parent | |
| 39 self.domain = domain | |
| 40 self.target = target | |
| 41 self.source = source |
