Language of plugin permissions

Added by Markus Bockman over 10 years ago

Is there a way to set the name of the permissions in the administration?

permission :view_redmine_usercenter, {:groups => [:view]}, :require => :member

In the roles this displays as "View redmine usercenter". I want to put a symbol of an entry of the language file, so that in every language the corret spelling is.

possible?

Replies (7)

RE: Language of plugin permissions - Added by Markus Bockman over 10 years ago

Nobody knows something?

RE: Language of plugin permissions - Added by Felix Schäfer over 10 years ago

I suppose having a view_redmine_usercenter string in your language files would do the trick?

RE: Language of plugin permissions - Added by Markus Bockman over 10 years ago

Yes this would do it, but maybe look like this: View redmine usercenter.
What I want to do is that what redmine already does. Display the permission strings in the language choosen in the control panel.

Example that not work:
permission l(:language_label), {:groups => [:view]}, :require => :member

RE: Language of plugin permissions - Added by Felix Schäfer over 10 years ago

I just had a closer look at the source, it should work to define your permission like this:

permission :view_redmine_usercenter, {:groups => [:view]}, :require => :member

and add a string called permission_view_redmine_usercenter to your locale file. It looks like the translation only occurs in the view and prepends the symbol of the permission with permission_ (see source://trunk/app/views/roles/report.rhtml#L34 and source://trunk/config/locales/en.yml#L333 and following).

RE: Language of plugin permissions - Added by Markus Bockman over 10 years ago

Thank you very much!

Thats it.

RE: Language of plugin permissions - Added by Felix Schäfer over 10 years ago

Glad it works :-) Could you please look if you have permissions to edit the wiki page about plugin development and mention it at the appropriate place?

(1-7/7)