89 |
|
|
90 |
if not msgid: |
if not msgid: |
91 |
# refuse to translate an empty msgid |
# refuse to translate an empty msgid |
92 |
return default or msgid |
return default |
93 |
|
|
94 |
|
# ZPT passes the object as context. That's wrong according to spec. |
95 |
|
try: |
96 |
|
context = context.REQUEST |
97 |
|
except AttributeError: |
98 |
|
pass |
99 |
|
|
100 |
if target_language is None: |
if target_language is None: |
101 |
if context is None: |
if context is None: |
121 |
# it's not in this catalog, try the next one |
# it's not in this catalog, try the next one |
122 |
pass |
pass |
123 |
else: |
else: |
124 |
# Did the fallback fail? Sigh, use the default |
# Did the fallback fail? Sigh, use the default. |
125 |
if default is None: |
# OpenTAL provides a default text. |
126 |
# OpenTAL provides a default text. |
# TAL doesn't but will use the default |
127 |
# TAL doesn't but will use the default |
# if None is returned |
128 |
# if None is returned |
text = default |
|
text = None |
|
|
else: |
|
|
text = default |
|
129 |
|
|
130 |
# Now we need to do the interpolation |
# Now we need to do the interpolation |
131 |
text = self.interpolate(text, mapping) |
text = self.interpolate(text, mapping) |