Log message for revision 66791: Made sure LocalizerLanguages class normalized language codes to xx-yy.
Changed: U Products.Five/branches/1.4/CHANGES.txt U Products.Five/branches/1.4/i18n.py -=- Modified: Products.Five/branches/1.4/CHANGES.txt =================================================================== --- Products.Five/branches/1.4/CHANGES.txt 2006-04-10 15:21:47 UTC (rev 66790) +++ Products.Five/branches/1.4/CHANGES.txt 2006-04-10 15:25:56 UTC (rev 66791) @@ -2,6 +2,12 @@ Five Changes ============ +Five 1.4.0 (unreleased) +======================= + +* Made sure LocalizerLanguages class normalized language codes to xx-yy, instead of + xx_YY or xx-YY. + Five 1.4b (2006-03-31) ====================== Modified: Products.Five/branches/1.4/i18n.py =================================================================== --- Products.Five/branches/1.4/i18n.py 2006-04-10 15:21:47 UTC (rev 66790) +++ Products.Five/branches/1.4/i18n.py 2006-04-10 15:25:56 UTC (rev 66791) @@ -19,6 +19,7 @@ from zope.interface import implements from zope.i18n import interpolate from zope.i18n.interfaces import ITranslationDomain, IUserPreferredLanguages +from zope.i18n.negotiator import normalize_lang from zope.app import zapi from zope.publisher.browser import BrowserLanguages @@ -71,7 +72,9 @@ accept_language = self.context.AcceptLanguage langs = [] for lang, node in accept_language.children.items(): - langs.append((node.get_quality(), lang)) + # Localizer may use xx_YY and xx-YY as language codes, + # while Zope expect xx-yy only, so we normalize the code here. + langs.append((node.get_quality(), normalize_lang(lang))) langs.extend([(n.get_quality(), l) for l, n in node.children.items()]) langs.sort() _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins