Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review state should be translatable on folder_contents page #2419

Closed
terapyon opened this issue May 16, 2018 · 12 comments
Closed

Review state should be translatable on folder_contents page #2419

terapyon opened this issue May 16, 2018 · 12 comments

Comments

@terapyon
Copy link
Member

BUG REPORT

Review state should be translatable on folder_contents page

2018-05-16 19 37 18

What I expect to happen:

@@getVocabulary should return new property review_state_title and this property should be used on the page. Because review_state property already be used view class as state-private, it means review_state could not be translatable.

What actually happened:

@@getVocabulary

review_state: "private"

What version of Plone

Plone 5.1.2

@erral
Copy link
Member

erral commented Jul 3, 2020

If we just add _t('') to address this, we will have to translate review state names also in mockup. Perhaps it's a first step, but I think we should take the translations from plone domain. Although achieving that from mockup is like science-fiction for me 😄

@vincentfretin
Copy link
Member

This issue is a hard one. You need to get the title that is defined for the workflow state, not try to translate the id. There may be a change to do in plone.app.content?

@vincentfretin
Copy link
Member

Capture d’écran de 2020-07-03 10-00-05
The javascript call a view getVocabulary to retrieve the data for each item.

Btw @tisto I didn't test volto recently, but do you have the review state correctly translated in folder contents in volto? Maybe you can shed some light on this issue? How do you do it properly in volto?

@erral
Copy link
Member

erral commented Jul 3, 2020

If I am not wrong we translate all workflow and content-type names in plone.restapi endpoints. I was working on it in a Sprint some time ago, indeed 😄

@vincentfretin
Copy link
Member

vincentfretin commented Jul 3, 2020

I guess you still need the review_state as id for the filters or for the style, so we should add the review_state_title (already translated with translate(workflow_label, context=self.request) in the returned json?

@erral
Copy link
Member

erral commented Jul 3, 2020

Yeah, something like that. See what we did with transitions, for instance: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/workflow/info.py#L54

@vincentfretin
Copy link
Member

Ah ah, so you know there is a change do be made in the python code that create this json and then a change in mockup to use the new key in the json to show the workflow state.

@erral
Copy link
Member

erral commented Jul 6, 2020

I had to make 2 changes to achieve this:

A similar strategy can be used for portal types. I find the vocabulary changes a bit hacky, but I think that there is no other way to achieve this.

I didn't just exchange the value of the review_state with its translated version because the original review_state value could be useful for other purposes, not just for rendering it in folder_contents view.

Any comment?

@vincentfretin
Copy link
Member

You're right about not changing the value for review_state, otherwise it would be a breaking change.
I left a comment on each commit.

@vincentfretin
Copy link
Member

@erral You can create a PR as draft for your branch so we have more visibility you are working on it.

@erral
Copy link
Member

erral commented Jul 8, 2020

I thought I already did this, sorry. I created plone/plone.app.content#207 and plone/mockup#1001

@jensens
Copy link
Member

jensens commented Mar 12, 2023

So, just checked, here it translates the state: 6.0.2 classicui

@jensens jensens closed this as completed Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants