[Zope3-checkins] CVS: Zope3/src/zope/i18n - globaltranslationservice.py:1.9 interfaces.py:1.14 simpletranslationservice.py:1.8 translate.py:1.7

Barry Warsaw barry@zope.com
Thu, 17 Apr 2003 16:05:44 -0400


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

Modified Files:
	globaltranslationservice.py interfaces.py 
	simpletranslationservice.py translate.py 
Log Message:
Make the various i18n interfaces more consistent in their argument
order.  Some required domain before msgid, others had those two
reversed.  We standardize on msgid before domain because msgid can be
a MessageID instance which carries its domain around with it.  So in
that case we don't need to specify domain and can make it an argument
with a default value of None.

Update all found call sites of the old order, fixed interfaces and
tests.  Ran the tests and z3.py with Python 2.2.2 -- I hope I got them
all!


=== Zope3/src/zope/i18n/globaltranslationservice.py 1.8 => 1.9 ===
--- Zope3/src/zope/i18n/globaltranslationservice.py:1.8	Tue Apr 15 17:16:10 2003
+++ Zope3/src/zope/i18n/globaltranslationservice.py	Thu Apr 17 16:05:13 2003
@@ -65,7 +65,7 @@
             fallbacks = LANGUAGE_FALLBACKS
         self._fallbacks = fallbacks
 
-    def translate(self, domain, msgid, mapping=None, context=None,
+    def translate(self, msgid, domain=None, mapping=None, context=None,
                   target_language=None, default=None):
         '''See interface ITranslationService'''
         if target_language is None and context is not None:


=== Zope3/src/zope/i18n/interfaces.py 1.13 => 1.14 ===
--- Zope3/src/zope/i18n/interfaces.py:1.13	Mon Apr 14 12:21:46 2003
+++ Zope3/src/zope/i18n/interfaces.py	Thu Apr 17 16:05:13 2003
@@ -122,7 +122,7 @@
         Also note that language tags are defined by RFC 1766.
     """
 
-    def translate(domain, msgid, mapping=None,
+    def translate(msgid, domain=None, mapping=None,
                   context=None, target_language=None,
                   default=None):
         """Return the translation for the message referred to by msgid.


=== Zope3/src/zope/i18n/simpletranslationservice.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/simpletranslationservice.py:1.7	Fri Apr 11 09:20:13 2003
+++ Zope3/src/zope/i18n/simpletranslationservice.py	Thu Apr 17 16:05:13 2003
@@ -56,7 +56,7 @@
             self.messages = messages
 
 
-    def translate(self, domain, msgid, mapping=None, context=None,
+    def translate(self, msgid, domain=None, mapping=None, context=None,
                   target_language=None, default=None):
         '''See interface ITranslationService'''
         # Find out what the target language should be


=== Zope3/src/zope/i18n/translate.py 1.6 => 1.7 ===
--- Zope3/src/zope/i18n/translate.py:1.6	Fri Apr 11 15:18:57 2003
+++ Zope3/src/zope/i18n/translate.py	Thu Apr 17 16:05:13 2003
@@ -66,6 +66,6 @@
         #     specify context=self.request and just ignore
         #     self._locale.id.language.
         return self._translation_service.translate(
-            self._domain, msgid, mapping=mapping,
+            msgid, self._domain, mapping=mapping,
             target_language=self._locale.id.language,
             default=default)