Are roles name and description going to be translated ?

Are roles name and description going to be translated ?

by Philip Siwinski -
Number of replies: 8
Hi,

I wonder if in Moodle 2.0, name and description of each role are going to be translated ?

Of course it is possible to change the name and desc. manually but I guess it is not a good practice.

Thanks.
Average of ratings: -
In reply to Philip Siwinski

Re: Are roles name and description going to be translated ?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I think the roles are initially created with names in whatever language you choose during install.

There is no problem editing the names or descriptions of the standard roles. Just don't change the shortname - that is for internal use.
In reply to Tim Hunt

Re: Are roles name and description going to be translated ?

by Philip Siwinski -
Currently, on 2.0, the roles are initially created in English.

Why do you recommend not to change shortnames when that possibility exists ?

Changing (translating) the shortnames, I discovered accentuated letters are replaced with non accentuated letters when saving the changes. I understand it is forbidden to use accentuated letters as shortnames are for internal use.
In reply to Philip Siwinski

Re: Are roles name and description going to be translated ?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If there is no way to install Moodle 2.0 with French (for example) role names, then that is a bug. Please report it to the tracker.

Short names are for internal use. Although no core Moodle code relies on them (I think) a number of customisations do. And, you will sometimes see people exchanging useful database queries in these forums that include things like WHERE role.shortname = 'student'. Changing role shortnames would be a bit like wanting to change the mod/quiz/view.php bit of a Moodle URL.
In reply to Tim Hunt

Re: Are roles name and description going to be translated ?

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Hmm, hardcoding of role names was a bad idea in the first place, we should have used lang pack strings instead.

I have already proposed a solution for this:
1/ keep the role->name empty by default
2/ if role->name empty use get_string('rolename_'.$role->shortname, 'role')

This way role default names would be properly localised.
Average of ratings: Useful (2)
In reply to Petr Skoda

Re: Are roles name and description going to be translated ?

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
+1 Petr. The current behaviour has caused confusion more than once in non-english environments, and your proposal would solve this.
In reply to Tim Hunt

Re: Are roles name and description going to be translated ?

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
As a matter of fact, there is a bug in Moodle 2.0 PR4 when installing Moodle in other languages: MDL-22657.
In reply to Nicolas Martignoni

Re: Are roles name and description going to be translated ?

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Petr just fixed MDL-22657, so the installation works in other languages and the role names are adequately set in your language.

Thanks to him smile

Average of ratings: Useful (1)
In reply to Nicolas Martignoni

Re: Are roles name and description going to be translated ?

by Andrea Bicciolo -
Hi,

just reopened the bug as the CLi installer seems to be fixed to support Petr changes.