zopefoundation / zope.app.i18n

Persistent translation domains and message catalogs
Other
0 stars 5 forks source link

Support newer zope.i18n (without actually supporting plural translations) #8

Closed mgedmin closed 4 years ago

mgedmin commented 5 years ago

Intended to fix #7.

There may be more work to it than I originally thought.

mgedmin commented 5 years ago

Meanwhile I've opened #9 for fixing the tests Right Now to unblock the other PRs.

mgedmin commented 5 years ago

I wonder if @thefunny42 who implemented the plural translation support in zope.i18n could be enticed to help with this...

thefunny42 commented 5 years ago

To be honest we do not use this package, and I am not sure what it does. We use the translation feature with a msgid:

         _('This template consists of ${count} item',
            msgid_plural='This template consists of ${count} items',
            number=self.count,
            mapping={'count': self.count})

That we use in a template or just call zope.i18n.translate() on. The only feedback I have, is that the tool we use to extract translations (a patched lingua to support plurals, among others) does not like at all multiple lines on msgid_plural).

icemac commented 4 years ago

@mgedmin Is this PR ready to merge? (At least to unblock using a current zope.i18n version.)

mgedmin commented 4 years ago

@mgedmin Is this PR ready to merge?

Not really?

It needs somebody who uses zope.app.i18n to play with the new zope.i18n and see what works and what breaks and what needs fixing.

I'm not currently using zope.app.i18n.

icemac commented 4 years ago

Same here: I neither use zope.app.i18n.

sallner commented 4 years ago

@mgedmin I would actually be very happy, if we could merge that somehow. On multiple occasions I wanted to install zodbbrowser lately and there is the transitive dependency via zope.app.zcmlfiles, which causes trouble.

Could it be an option to explicitly raise a NotImplementedError if the translate() is called with the new attributes and state that in the readme? We could also encourage the users to open up an issue here, in case they need it.

mgedmin commented 4 years ago

Could it be an option to explicitly raise a NotImplementedError if the translate() is called with the new attributes and state that in the readme? We could also encourage the users to open up an issue here, in case they need it.

That sounds better than the status quo, but somebody would have to prepare a PR.

sallner commented 4 years ago

Then I will try to do it tomorrow.

sallner commented 4 years ago

@mgedmin I think I got every place of use.

sallner commented 4 years ago

Thanks for the feedback, I merge that now. @mgedmin Do you mind creating a new release?

jamadden commented 4 years ago

4.1.0 is on PyPI.