[Zope3-checkins] SVN: Zope3/trunk/src/zope/ - Fixed resetting of
getServices() hook.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Aug 1 17:08:31 EDT 2005
Log message for revision 37640:
- Fixed resetting of getServices() hook.
- Make sure the TestRequest finds a locale.
Changed:
U Zope3/trunk/src/zope/app/component/hooks.py
U Zope3/trunk/src/zope/publisher/browser.py
-=-
Modified: Zope3/trunk/src/zope/app/component/hooks.py
===================================================================
--- Zope3/trunk/src/zope/app/component/hooks.py 2005-08-01 20:47:18 UTC (rev 37639)
+++ Zope3/trunk/src/zope/app/component/hooks.py 2005-08-01 21:08:31 UTC (rev 37640)
@@ -101,7 +101,7 @@
def setHooks():
zope.component.adapter_hook.sethook(adapter_hook)
zope.component.getSiteManager.sethook(getSiteManager)
- # Goes away in 3.3.
+ # BBB: Goes away in 3.3.
zope.deprecation.__show__.off()
from bbb import hooks
zope.component.getServices.sethook(hooks.getServices_hook)
@@ -111,4 +111,5 @@
# Reset hookable functions to original implementation.
zope.component.adapter_hook.reset()
zope.component.getSiteManager.reset()
-
+ # BBB: Goes away in 3.3.
+ zope.component.getServices.reset()
Modified: Zope3/trunk/src/zope/publisher/browser.py
===================================================================
--- Zope3/trunk/src/zope/publisher/browser.py 2005-08-01 20:47:18 UTC (rev 37639)
+++ Zope3/trunk/src/zope/publisher/browser.py 2005-08-01 21:08:31 UTC (rev 37640)
@@ -629,6 +629,15 @@
if form:
self.form.update(form)
+ # Setup locale object
+ langs = BrowserLanguages(self).getPreferredLanguages()
+ from zope.i18n.locales import locales
+ if not langs or langs[0] == '':
+ self._locale = locales.getLocale(None, None, None)
+ else:
+ parts = (langs[0].split('-') + [None, None])[:3]
+ self._locale = locales.getLocale(*parts)
+
if skin is not None:
directlyProvides(self, skin)
else:
More information about the Zope3-Checkins
mailing list