98 |
langs = [m[0] for m in self._catalogs.keys() if m[1] == domain] |
langs = [m[0] for m in self._catalogs.keys() if m[1] == domain] |
99 |
target_language = negotiator.getLanguage(langs, context) |
target_language = negotiator.getLanguage(langs, context) |
100 |
|
|
|
|
|
101 |
# Get the translation. Use the specified fallbacks if this fails |
# Get the translation. Use the specified fallbacks if this fails |
102 |
catalog_names = self._catalogs.get((target_language, domain), ()) |
catalog_names = self._catalogs.get((target_language, domain), ()) |
103 |
if not catalog_names: |
if not catalog_names: |
115 |
# it's not in this catalog, try the next one |
# it's not in this catalog, try the next one |
116 |
pass |
pass |
117 |
else: |
else: |
118 |
# Did the fallback fail? Sigh, use the default or msgid |
# Did the fallback fail? Sigh, use the default |
119 |
if default is None: |
if default is None: |
120 |
text = msgid |
# OpenTAL provides a default text. |
121 |
|
# TAL doesn't but will use the default |
122 |
|
# if None is returned |
123 |
|
text = None |
124 |
else: |
else: |
125 |
text = default |
text = default |
126 |
|
|