plone / plone.app.z3cform

A Plone specific integration and HTML mark-up for z3c.form
https://pypi.org/project/plone.app.z3cform
6 stars 22 forks source link

Statusmessage type is untranslated when using @@ploneform-macros/form with different domain from another package #110

Open fredvd opened 4 years ago

fredvd commented 4 years ago

I'm looking into a weird translation problem where collective.easyform 'global' form errors have an untranslated type. It always says 'Error' in every language. This might be a problem in the way collective.easyform is calling the macro, where the calling template has i18n:domain set to collective.easyform instead of plone :

https://github.com/collective/collective.easyform/blob/5d18bce01c104ae44fc3a11086a4f7475951aa93/src/collective/easyform/browser/easyform_form.pt#L1-L6

it is this part in the form macros.pt which isn't translated:

https://github.com/plone/plone.app.z3cform/blob/86326cfa3dbd039d13245e3a18ff1ed0c88a004a/plone/app/z3cform/templates/macros.pt#L20-L22

A solution would be to add i18n:domain="plone" to line 20 . As said, I'm not sure if the problem isn't in easyform, because a lot of the translations for validation errors and other messages are duplicated in the collective.easyform domain. See the screenshots below for the testform views in Dutch and German, collective.easyform doesn't have Dutch translations (but does have German ones), but all error mesages are still translated in Dutch.

On the other hand, i18ndude cannot pick up these translations for the status message type as they are in plone.app.z3cform: To fix this in easyform I'd have to add an extra collective-easform-manual.pot which has to be merged with the translations picked up by i18ndude. Which is also double work for every addon using z3c.form macros.

@mauritsvanrees Found it...

testformular-deutsch form-errors-dutch
mauritsvanrees commented 4 years ago

Adding i18n:domain="plone" sounds good to me.

jensens commented 1 year ago

40 could be related

fredvd commented 1 year ago

I think we should just add the i18n:domain and then it's solved. I'll create a PR.