4teamwork/ftw.lawgiver — pull request #23 by jone (2013-08-08 13:51:12+00:00)
Title: Make roles translatable

This pull request implements some of the requirements defined in #11

- The lawgiver overrides the Plone default role utilites, making them adapters (context, request). This allows us to change the role translations depending on the workflow of the current context dynamically.

- The `DynamicRoleAdapter`'s, registered for Plone default roles by default, use workflow-specific role translations (e.g. `my-workflow--ROLE--Editor`) and fall back to the Plone default, so that non-lawgiver workflows still work. Therefore no additional configuration is required for the default roles (`Reader`, `Editor`, `Contributor`, `Reviewer`).

- When in need, new roles can be easily registered so that show up in the ``@sharing`` page (and all other tools wich work with the utilites, such as `ftw.permissionmanager`) and are translated properly. See also the readme changes for instructions.

**usage**

For changing the translation in the ``sharing`` to the "customer roles" used in the `specification.txt`, simple the proposed translations from the lawgiver specification details view have to be copied into a `plone.po`. This works for default Plone roles without any further changes.

:construction:

TODO

- Make only roles used by the workflows show up in the ``sharing`` by default. I think it is important that this is explicitly configured in the `specification.txt` and not automagically done.

@maethu please take a look, I'll deliver the missing parts shortly.

/cc @phabegger