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

Include translated role title in `@roles` GET #545

Merged
merged 4 commits into from Jun 23, 2018

Conversation

Projects
None yet
4 participants
@lukasgraf
Member

lukasgraf commented Jun 23, 2018

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

lukasgraf added some commits Jun 22, 2018

Enable request language negotiation during tests.
This is so we can use the Accept-Language header to request translated
pieces of content in different languages.
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.

Note that the sharing view uses a different set of translations
for the same role ID.

@lukasgraf lukasgraf requested review from jaroel, tisto and erral Jun 23, 2018

@erral

erral approved these changes Jun 23, 2018

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

@coveralls

This comment has been minimized.

coveralls commented Jun 23, 2018

Coverage Status

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

@tisto

tisto approved these changes Jun 23, 2018

Thank you Lukas!

@tisto tisto merged commit aef7c20 into master Jun 23, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 96.435%
Details

@tisto tisto deleted the roles-titles branch Jun 23, 2018

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