Feature #2746 - Translations on the course homepage: Disabling old code for transitional purposes. Now translations of the tool names rely only on the new Tool* variables.

skala
Ivan Tcholakov 14 years ago
parent 403d05088d
commit 42a5f259e6
  1. 7
      main/inc/lib/course_home.lib.php

@ -841,8 +841,11 @@ class CourseHome {
if (in_array($tool['image'], $already_translated_icons)) {
$tool_name = Security::remove_XSS(stripslashes($tool['name']));
} else {
/*
// The following (slow) code was made in the past for transitional purposes.
// We assume that the new language variables Tool* have been already translated.
$variable = 'Tool'.api_underscore_to_camel_case($tool['name']); // The newly opened language variables.
$variable_old = ucfirst($tool['name']); // The old language variables as a second chance exist.
$variable_old = ucfirst($tool['name']); // The old language variables as a second chance.
if (api_is_translated($variable)) {
$tool_name = get_lang($variable);
} elseif (api_is_translated($variable_old)) {
@ -850,6 +853,8 @@ class CourseHome {
} else {
$tool_name = get_lang($variable);
}
*/
$tool_name = get_lang('Tool'.api_underscore_to_camel_case($tool['name']));
}
return $tool_name;

Loading…
Cancel
Save