Skip to content

Conversation

@lukasgraf
Copy link
Member

Include translated role title in @roles GET:

This returns the translated role name (as displayed in the "Users and Groups" control panel) as the title property in the output of the @roles endpoint.

Also includes some groundwork in setting up languages (available & supported, request negotiation) consistently during tests.

/cc @erral


Note that the sharing view uses a different set of translations for the same role ID. At first, my intent was to use the same serialization of roles (plus their titles) for both the @roles endpoint as well as well as the available roles in the @sharing endpoint.

But since Plone itself uses different translations for roles in two places, I would suggest to just handle them seperately in these endpoints as well:

Examples for how role titles are currently translated in Plone 5:

"Users and Groups" Control Panel

roles_en

roles_de


Sharing Page

sharing_roles_en

sharing_roles_de

This is so we can use the Accept-Language header to request translated
pieces of content in different languages.
This returns the translated role name (as displayed in the
"Users and Groups" control panel) as the title property in the
output of the @roles endpoint.

Note that the sharing view uses a different set of translations
for the same role ID.
@lukasgraf lukasgraf requested review from erral, jaroel and tisto June 23, 2018 09:00
Copy link
Member

@erral erral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Specially the test-setup changes are much easier now.

@coveralls
Copy link

coveralls commented Jun 23, 2018

Coverage Status

Coverage increased (+0.02%) to 96.435% when pulling bfcc094 on roles-titles into fb94ad7 on master.

Copy link
Member

@tisto tisto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Lukas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants