-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
2.2.4
-
None
-
linux php postgresql apache
-
MOODLE_22_STABLE
-
-
Hi
Today to see his course log a non-english speaker will see the terms of the action collumn in english wich in terms of usability is not the best way to present the logs.
Is there any plan to translate the logs ?
I just try it with the help of get_string to look in the apropiate module file, but it fails in some terms like closeattempt, deletemod and others i could not find and as a result the term end not being translated.
Here is the code we try to aply, in the course/lib.php file.
If some one like the idea and can see any way to fully translate the course logs it would be apreciated.
/* Custom start */
$modules = $DB->get_records_menu('modules', array(),'','name,id');
foreach($modules as $modulename=>$moduleid){
$modulenames[] =$modulename;
}
if(in_array($log->module, $modulenames)){
$langfile = $log->module;
$strmodule = get_string("pluginname",$langfile);
} else{
$langfile = "moodle";
$strmodule = get_string("$log->module");
}
$stractionfirst = str_replace(' ', '', $log->action);
$straction = get_string($stractionfirst,$langfile);
if( strpos($straction,'[') ){
$straction = get_string($stractionfirst);
}
$displayaction="$straction $strmodule";
/* Custom end */
// original code
// $displayaction="$log->module $log->action";
Of course this line : $stractionfirst = str_replace(' ', '', $log->action); glues together two terms and this causes the term never being found, here we need a solution.
Cheers
- duplicates
-
MDL-1933 Analyse the possibility of translate logs->action (display)
-
- Closed
-