plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
255 stars 191 forks source link

"Error" not internationalized in Document add form #3126

Closed vincentfretin closed 4 years ago

vincentfretin commented 4 years ago

BUG

What I did:

With Plone in non-English language, create a Document, leave the required Title field empty, click on Save

What I expect to happen:

The error message perfectly localized: Erreur Il y a des erreurs. Capture d’écran de 2020-06-28 09-55-21

What actually happened:

Error Il y a des erreurs.

What version of Plone/ Addons I am using:

Plone 5.2.2rc1

vincentfretin commented 4 years ago

Somebody know how this error message is rendered? I have no clue where to look.

We have the Info, Error and Warning in the po file.

vincentfretin commented 4 years ago

This error message is not rendered by plone.app.layout/plone/app/layout/viewlets/globalstatusmessage.pt Probably rendered in javascript? Where? How?

vincentfretin commented 4 years ago

No it's not rendered in javascript, I see the full html structure in the html response when I save.

vincentfretin commented 4 years ago

I found it in plone.app.z3cform/plone/app/z3cform/templates/macros.pt If a replace

<dt i18n:translate="">Error</dt>

by

<dt i18n:translate="" i18n:domain="plone">Error</dt>

this fixes it. But it's weird because we have i18n:domain="plone" in the root tag, but it doesn't same to care... Chameleon issue?

mauritsvanrees commented 4 years ago

Maybe the root domain is not picked up because this is in a macro.

vincentfretin commented 4 years ago

Yes you're probably right. There may be another domain defined in the caller. I didn't investigated further.