The z3c.pt package relies on Zope's language negotiation utility zope.i18n.INegotiator but plone.i18n does not register such a utility, instead relying on Zope's own negotiation logic which is not the same as plone.i18n.
The result is that different languages may be used on the same page.
For example, the following simply uses the Plone-negotiated language:
from zope.interface import implements
from zope.i18n.interfaces import INegotiator
class Negotiator(object):
implements(INegotiator)
def getLanguage(self, langs, env):
"""Return the language that's already set up by Plone."""
return env.get('LANGUAGE', 'en')
negotiator = Negotiator()
The
z3c.pt
package relies on Zope's language negotiation utilityzope.i18n.INegotiator
butplone.i18n
does not register such a utility, instead relying on Zope's own negotiation logic which is not the same asplone.i18n
.The result is that different languages may be used on the same page.
For example, the following simply uses the Plone-negotiated language: