From 42a5f259e6408fb4c38eb7a213f987f6ebada2ca Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Sat, 5 Feb 2011 16:51:18 +0200 Subject: [PATCH] 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. --- main/inc/lib/course_home.lib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/course_home.lib.php b/main/inc/lib/course_home.lib.php index c61cbe55a3..fd59903e76 100755 --- a/main/inc/lib/course_home.lib.php +++ b/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;