[Zope3-checkins] CVS: Zope3/src/zope/i18n - simpletranslationservice.py:1.12

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 2 12:49:56 EST 2004


Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv28333/src/zope/i18n

Modified Files:
	simpletranslationservice.py 
Log Message:


Completed making the language negotiator a utility.



Make sure the translation service is looking for a utility as well.




=== Zope3/src/zope/i18n/simpletranslationservice.py 1.11 => 1.12 ===
--- Zope3/src/zope/i18n/simpletranslationservice.py:1.11	Tue Feb 24 09:07:18 2004
+++ Zope3/src/zope/i18n/simpletranslationservice.py	Tue Mar  2 12:49:26 2004
@@ -17,8 +17,8 @@
 """
 import re
 
-from zope.component import getService
-from zope.i18n.interfaces import ITranslationService
+from zope.component import getUtility
+from zope.i18n.interfaces import ITranslationService, INegotiator
 from zope.interface import implements
 
 
@@ -63,7 +63,7 @@
         if target_language is None and context is not None:
             langs = [m[1] for m in self.messages.keys()]
             # Let's negotiate the language to translate to. :)
-            negotiator = getService(self, 'LanguageNegotiation')
+            negotiator = getUtility(self, INegotiator)
             target_language = negotiator.getLanguage(langs, context)
 
         # Make a raw translation without interpolation




More information about the Zope3-Checkins mailing list