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.
16 The translation context provides a container for the information
17 needed to perform translation of a marked string from a page template.
19 $Id: TranslationContext.py,v 1.1 2004-05-21 05:36:30 richard Exp $
20 """
22 DEFAULT_DOMAIN = "default"
24 class TranslationContext:
25 """Information about the I18N settings of a TAL processor."""
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
38 self.parent = parent
39 self.domain = domain
40 self.target = target
41 self.source = source