Closed jamadden closed 7 years ago
It looks like the IZopeConfigure
schema defines i18n_domain
as a BytesLine
because it's meant to deal with the filesystem. That's probably not really correct on Python 3, when paths changed to be decoded strs (though bytes are often still accepted by the path APIs).
So it seems the simplest change will be to handle this in MessageID, and use sys.getfilesystemencoding
to handle the decoding.
As discovered in zope.app.form, when reading a MessageID field out of a ZCML file, the
domain
will be abyte
string under Python 3 (e.g.,b'zope'
). Butzope.i18n
registers ITranslationDomain utilities with normalstr
names. Since no byte string can ever equal astr
on Python 3, the utilities will never be found and translation will not happen.It seems to me that either MessageID should ensure that the domain is a
str
(decoding from...utf-8?) or the context itself could ensure that itsi18n_domain
is astr
. I think I like the latter better.