diff --git a/lib/accesslib.php b/lib/accesslib.php
index dd7f5b0..331ec84 100644
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -4099,20 +4099,30 @@ function role_get_name($role, context_course $coursecontext) {
  * @return array Array of context-specific role names, or role objexts with a ->localname field added.
  */
 function role_fix_names($roleoptions, context $context, $rolenamedisplay = ROLENAME_ALIAS) {
-    global $DB;
+    global $DB, $CFG, $USER;    // System configuration and user info are required to make the proper translation
 
     // Make sure we have a course context.
     $coursecontext = $context->get_course_context(false);
 
+    // MDL-33970 - Role names optionally translated from the language packs if available.
     // Make sure we are working with an array roleid => name. Normally we
-    // want to use the unlocalised name if the localised one is not present.
+    // want to use the localized name, or the translated name, or even the
+    // unlocalised name as the last alternative, in that order.
+    // New rolename string definitions would be in the format: 'rolename:<ROLE_SHORTNAME>' @ /lang/<LANG>/role.php
     $newnames = array();
     foreach ($roleoptions as $rid => $roleorname) {
         if ($rolenamedisplay != ROLENAME_ALIAS_RAW) {
             if (is_object($roleorname)) {
-                $newnames[$rid] = $roleorname->name;
+                // try to load the translated role name
+                get_string_manager()->string_exists('rolename:'.$roleorname->shortname, 'role') ?   // string exists?
+                        $newnames[$rid] = get_string('rolename:'.$roleorname->shortname, 'role') :  // load it if true
+                        $newnames[$rid] = $roleorname->name;                                        // keep database value for now
             } else {
-                $newnames[$rid] = $roleorname;
+                // load role shortname to try to load the translated role name
+                $role_shortname = $DB->get_field('role', 'shortname', array('id'=>$rid));
+                get_string_manager()->string_exists('rolename:'.$role_shortname, 'role') ?          // string exists?
+                        $newnames[$rid] = get_string('rolename:'.$role_shortname, 'role') :         // load it if true
+                        $newnames[$rid] = $roleorname;                                              // keep database value for now
             }
         } else {
             $newnames[$rid] = '';
