Correction crash
[auf_roundup.git] / build / lib / roundup / cgi / TAL / TranslationContext.py
CommitLineData
c638d827
CR
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
16The translation context provides a container for the information
17needed 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
22DEFAULT_DOMAIN = "default"
23
24class 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