[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/translation - translate.py:1.3
Barry Warsaw
barry@zope.com
Thu, 17 Apr 2003 16:05:42 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/services/translation
In directory cvs.zope.org:/tmp/cvs-serv14704/src/zope/app/browser/services/translation
Modified Files:
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/app/browser/services/translation/translate.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/services/translation/translate.py:1.2 Wed Dec 25 09:12:38 2002
+++ Zope3/src/zope/app/browser/services/translation/translate.py Thu Apr 17 16:05:11 2003
@@ -38,8 +38,8 @@
def getTranslation(self, domain, msgid, target_lang):
- return self.context.translate(domain, msgid,
- target_language=target_lang)
+ return self.context.translate(
+ msgid, domain, target_language=target_lang)
def getEditLanguages(self):
@@ -59,7 +59,7 @@
msg_id = self.request['msg_id']
for language in self.getEditLanguages():
msg = self.request['msg_lang_%s' %language]
- if msg != self.context.translate(domain, msg_id,
+ if msg != self.context.translate(msg_id, domain,
target_language=language):
self.context.updateMessage(domain, msg_id, msg, language)
return self.request.response.redirect(self.request.URL[-1])
@@ -85,7 +85,7 @@
domain = self.request['edit-domain-'+key]
for language in self.getEditLanguages():
msg = self.request['edit-%s-%s' %(language, key)]
- if msg != self.context.translate(domain, msg_id,
+ if msg != self.context.translate(msg_id, domain,
target_language=language):
self.context.updateMessage(domain, msg_id, msg, language)