[Zope3-checkins] CVS: Zope3/src/zope/i18n - globaltranslationservice.py:1.8
Barry Warsaw
barry@zope.com
Tue, 15 Apr 2003 17:16:11 -0400
Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv25811/src/zope/i18n
Modified Files:
globaltranslationservice.py
Log Message:
translate(): When msgid is a MessageID, its domain, mapping, and
default attributes override the method arguments.
=== Zope3/src/zope/i18n/globaltranslationservice.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/globaltranslationservice.py:1.7 Fri Apr 11 09:20:13 2003
+++ Zope3/src/zope/i18n/globaltranslationservice.py Tue Apr 15 17:16:10 2003
@@ -73,9 +73,11 @@
langs = [m[0] for m in self._catalogs.keys()]
target_language = negotiator.getLanguage(langs, context)
- # Try to get domain from msgid.
+ # MessageID attributes override arguments
if isinstance(msgid, MessageID):
domain = msgid.domain
+ mapping = msgid.mapping
+ default = msgid.default
# Get the translation. Use the specified fallbacks if this fails
catalog_names = self._catalogs.get((target_language, domain))