From 8ff5955d3296e3094fd98b5b2bfbbe14e21d9070 Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Wed, 12 Jun 2024 15:46:05 -0500 Subject: [PATCH 1/4] Internal: Add .html.twig support to gettext migration script - refs BT#21777 --- public/main/inc/lib/fileManage.lib.php | 18 +++++++----------- tests/scripts/switch_files_to_gettext.php | 10 +++++----- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/public/main/inc/lib/fileManage.lib.php b/public/main/inc/lib/fileManage.lib.php index 63b26a9d61..9fd3819180 100644 --- a/public/main/inc/lib/fileManage.lib.php +++ b/public/main/inc/lib/fileManage.lib.php @@ -74,17 +74,12 @@ function copyDirTo($source, $destination, $move = true) /** * Get a list of all PHP (.php) files in a given directory. Includes .tpl files. - * - * @param string $base_path The base path in which to find the corresponding files - * @param bool $includeStatic Include static .html, .htm and .css files - * - * @return array */ -function getAllPhpFiles($base_path, $includeStatic = false) +function getAllPhpFiles(string $base_path, bool $includeStatic = false): array { $list = scandir($base_path); $files = []; - $extensionsArray = ['.php', '.tpl']; + $extensionsArray = ['.php', '.tpl', '.html.twig']; if ($includeStatic) { $extensionsArray[] = 'html'; $extensionsArray[] = '.htm'; @@ -101,10 +96,11 @@ function getAllPhpFiles($base_path, $includeStatic = false) if (is_dir($base_path.$item)) { $files = array_merge($files, getAllPhpFiles($base_path.$item.'/', $includeStatic)); } else { - //only analyse php files - $sub = substr($item, -4); - if (in_array($sub, $extensionsArray)) { - $files[] = $base_path.$item; + foreach ($extensionsArray as $extension) { + if (substr($item, -strlen($extension)) == $extension) { + $files[] = $base_path.$item; + break; + } } } } diff --git a/tests/scripts/switch_files_to_gettext.php b/tests/scripts/switch_files_to_gettext.php index fdef9768f0..f80bc2f507 100644 --- a/tests/scripts/switch_files_to_gettext.php +++ b/tests/scripts/switch_files_to_gettext.php @@ -32,7 +32,8 @@ echo count($defined_terms)." terms were found in language files".PHP_EOL; // time and memory) $usedTerms = []; $l = strlen(api_get_path(SYS_PATH)); -$files = getAllPhpFiles(api_get_path(SYS_PATH)); +$pathfile = api_get_path(SYS_PATH)."main/template/default/gamification/"; +$files = getAllPhpFiles($pathfile); $rootLength = strlen(api_get_path(SYS_PATH)); $countFiles = 0; $countReplaces = 0; @@ -59,13 +60,12 @@ foreach ($files as $file) { $translation = $terms[$term]; $quotedTerm = $myTerms[1][0]; //echo "Would do sed -i \"s#$quotedTerm#'$translation'#g\" $file here\n"; - system("sed -i \"s#$term#'$translation'#g\" $file"); + system("sed -i \"s#$quotedTerm#'$translation'#g\" $file"); $countReplaces++; } } } else { - $res = 0; - $res = preg_match_all('/\{\s*([\'"](\\w*)[\'"])\s*\|get_lang\}/m', $line, $myTerms); + $res = preg_match_all('/\{\{\s*([\'"](\\w*)[\'"])\s*\|get_lang\}\}/m', $line, $myTerms); if ($res > 0) { foreach ($myTerms[2] as $term) { echo "Found term $term".PHP_EOL; @@ -76,7 +76,7 @@ foreach ($files as $file) { $translation = $terms[$term]; $quotedTerm = $myTerms[1][0]; //echo "Would do sed -i \"s#$quotedTerm#'$translation'#g\" $file here\n"; - system("sed -i \"s#$term#'$translation'#g\" $file"); + system("sed -i \"s#$quotedTerm#'$translation'#g\" $file"); $countReplaces++; } } From f9601d45f397ba5d2f360020285271898039936e Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Thu, 13 Jun 2024 12:46:40 -0500 Subject: [PATCH 2/4] Internal: Fix language variable replacement script for Twig and PHP files - refs BT#21777 --- public/main/inc/lib/fileManage.lib.php | 11 +- tests/scripts/switch_files_to_gettext.php | 126 ++++++++++++++-------- 2 files changed, 88 insertions(+), 49 deletions(-) diff --git a/public/main/inc/lib/fileManage.lib.php b/public/main/inc/lib/fileManage.lib.php index 9fd3819180..8fbb1677a8 100644 --- a/public/main/inc/lib/fileManage.lib.php +++ b/public/main/inc/lib/fileManage.lib.php @@ -89,22 +89,21 @@ function getAllPhpFiles(string $base_path, bool $includeStatic = false): array if ('.' == substr($item, 0, 1)) { continue; } - $special_dirs = [api_get_path(SYS_TEST_PATH), api_get_path(SYS_COURSE_PATH), api_get_path(SYS_LANG_PATH), api_get_path(SYS_ARCHIVE_PATH)]; - if (in_array($base_path.$item.'/', $special_dirs)) { + $special_dirs = []; // Modify this array as needed + if (in_array($base_path . $item . '/', $special_dirs)) { continue; } - if (is_dir($base_path.$item)) { - $files = array_merge($files, getAllPhpFiles($base_path.$item.'/', $includeStatic)); + if (is_dir($base_path . $item)) { + $files = array_merge($files, getAllPhpFiles($base_path . $item . '/', $includeStatic)); } else { foreach ($extensionsArray as $extension) { if (substr($item, -strlen($extension)) == $extension) { - $files[] = $base_path.$item; + $files[] = $base_path . $item; break; } } } } - $list = null; return $files; } diff --git a/tests/scripts/switch_files_to_gettext.php b/tests/scripts/switch_files_to_gettext.php index f80bc2f507..6289d3fb8b 100644 --- a/tests/scripts/switch_files_to_gettext.php +++ b/tests/scripts/switch_files_to_gettext.php @@ -1,90 +1,130 @@ $translation) { $terms[$index] = trim(rtrim($translation, ';'), '"'); } -// get only the array keys (the language variables defined in language files) + +// Get only the array keys (the language variables defined in language files) $defined_terms = array_flip(array_keys($terms)); -echo count($defined_terms)." terms were found in language files".PHP_EOL; +echo count($defined_terms) . " terms were found in language files" . PHP_EOL; +//print_r($defined_terms); // Debug: print the terms found -// now get all terms found in all PHP files of Chamilo (this takes some -// time and memory) +// Now get all terms found in all PHP, TPL, and Twig files of Chamilo (this takes some time and memory) $usedTerms = []; $l = strlen(api_get_path(SYS_PATH)); -$pathfile = api_get_path(SYS_PATH)."main/template/default/gamification/"; -$files = getAllPhpFiles($pathfile); +$pathfile = api_get_path(SYS_PATH) . "main/template/default/gamification/my_progress.html.twig"; +$files = [$pathfile]; // Process only the specific file for now $rootLength = strlen(api_get_path(SYS_PATH)); $countFiles = 0; $countReplaces = 0; + // Browse files foreach ($files as $file) { - if ('vendor' === substr($file, $rootLength, 6) || 'web' === substr($file, $rootLength, 3)) { - continue; - } - //echo 'Analyzing '.$file.PHP_EOL; - $shortFile = substr($file, $l); - //echo 'Analyzing '.$shortFile.PHP_EOL; + echo "Analyzing $file" . PHP_EOL; $lines = file($file); + $newContent = ''; // Store new file content + $fileModified = false; + // Browse lines inside file $file - foreach ($lines as $line) { - $myTerms = []; - $res = preg_match_all('/get_lang\(([\'"](\\w*)[\'"])\)/m', $line, $myTerms); + foreach ($lines as $lineIndex => $line) { + $lineModified = false; + + // Regular expression for {{ 'variable'|get_lang|format() }} + $res = preg_match_all('/\{\{\s*([\'"]\w+[\'"])\s*\|\s*get_lang\s*\|\s*format\s*\((.*?)\)\s*\}\}/m', $line, $myTerms); if ($res > 0) { - foreach ($myTerms[2] as $term) { - echo "Found term $term - ".print_r($myTerms, 1).PHP_EOL; - if ('lang' == substr($term, 0, 4)) { - $term = substr($term, 4); + echo "Match found for get_lang|format in line: $line" . PHP_EOL; + foreach ($myTerms[1] as $index => $quotedTerm) { + $term = trim($quotedTerm, '\'\"'); + if (isset($terms[$term])) { + $translation = $terms[$term]; + echo "Replacing $quotedTerm with '$translation'" . PHP_EOL; + $line = str_replace($quotedTerm, "'$translation'", $line); + $lineModified = true; + $countReplaces++; + } else { + echo "Term $term not found in language file" . PHP_EOL; // Debug: term not found } - if (!empty($terms[$term])) { + } + } + + // Regular expression for {{ 'variable'|get_lang }} + $res = preg_match_all('/\{\{\s*([\'"]\w+[\'"])\s*\|\s*get_lang\s*\}\}/m', $line, $myTerms); + if ($res > 0) { + echo "Match found for get_lang in line: $line" . PHP_EOL; + foreach ($myTerms[1] as $index => $quotedTerm) { + $term = trim($quotedTerm, '\'\"'); + if (isset($terms[$term])) { $translation = $terms[$term]; - $quotedTerm = $myTerms[1][0]; - //echo "Would do sed -i \"s#$quotedTerm#'$translation'#g\" $file here\n"; - system("sed -i \"s#$quotedTerm#'$translation'#g\" $file"); + echo "Replacing $quotedTerm with '$translation'" . PHP_EOL; + $line = str_replace($quotedTerm, "'$translation'", $line); + $lineModified = true; $countReplaces++; + } else { + echo "Term $term not found in language file" . PHP_EOL; // Debug: term not found } } - } else { - $res = preg_match_all('/\{\{\s*([\'"](\\w*)[\'"])\s*\|get_lang\}\}/m', $line, $myTerms); - if ($res > 0) { - foreach ($myTerms[2] as $term) { - echo "Found term $term".PHP_EOL; - if ('lang' == substr($term, 0, 4)) { - $term = substr($term, 4); - } - if (!empty($terms[$term])) { - $translation = $terms[$term]; - $quotedTerm = $myTerms[1][0]; - //echo "Would do sed -i \"s#$quotedTerm#'$translation'#g\" $file here\n"; - system("sed -i \"s#$quotedTerm#'$translation'#g\" $file"); - $countReplaces++; - } + } + + // Regular expression for get_lang('variable') or get_lang("variable") + $res = preg_match_all('/get_lang\(([\'"](\w+)[\'"])\)/m', $line, $myTerms); + if ($res > 0) { + echo "Match found for get_lang() in line: $line" . PHP_EOL; + foreach ($myTerms[2] as $index => $term) { + if (isset($terms[$term])) { + $translation = $terms[$term]; + $quotedTerm = $myTerms[1][$index]; + echo "Replacing $quotedTerm with '$translation'" . PHP_EOL; + $line = str_replace($quotedTerm, "'$translation'", $line); + $lineModified = true; + $countReplaces++; + } else { + echo "Term $term not found in language file" . PHP_EOL; // Debug: term not found } } } + + $newContent .= $line; // Add modified line to new content + if ($lineModified) { + $fileModified = true; + } } + + // Write the modified content back to the file if there were modifications + if ($fileModified) { + file_put_contents($file, $newContent); + } + $countFiles++; - flush(); } echo "Done analyzing $countFiles files, with $countReplaces replacements!\n"; From 46aaff5ac0050eca48b906b5d1a0e7236773bbb2 Mon Sep 17 00:00:00 2001 From: NicoDucou Date: Wed, 3 Jul 2024 12:06:42 +0200 Subject: [PATCH 3/4] Internal: Fix script to transform translation variables in the template folder - refs BT#21777 --- tests/scripts/switch_files_to_gettext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scripts/switch_files_to_gettext.php b/tests/scripts/switch_files_to_gettext.php index 6289d3fb8b..3c37e3037b 100644 --- a/tests/scripts/switch_files_to_gettext.php +++ b/tests/scripts/switch_files_to_gettext.php @@ -42,8 +42,9 @@ echo count($defined_terms) . " terms were found in language files" . PHP_EOL; // Now get all terms found in all PHP, TPL, and Twig files of Chamilo (this takes some time and memory) $usedTerms = []; $l = strlen(api_get_path(SYS_PATH)); -$pathfile = api_get_path(SYS_PATH) . "main/template/default/gamification/my_progress.html.twig"; -$files = [$pathfile]; // Process only the specific file for now +$pathfile = api_get_path(SYS_PATH) . "main/template/"; //Path for the missing files, should be adapted for other use +$files = getAllPhpFiles($pathfile); +//$files = [$pathfile]; // Process only the specific file for now $rootLength = strlen(api_get_path(SYS_PATH)); $countFiles = 0; $countReplaces = 0; From 81f148a1d9f79fbd3c77d3abb5de0ef64da3510e Mon Sep 17 00:00:00 2001 From: NicoDucou Date: Wed, 3 Jul 2024 12:08:21 +0200 Subject: [PATCH 4/4] Language: Internal: transform translation variables to gettext for templates - refs BT#21777 --- .../default/admin/career_dashboard.html.twig | 2 +- .../admin/gradebook_dependency.html.twig | 2 +- .../default/admin/gradebook_list.html.twig | 2 +- .../default/admin/resource_sequence.html.twig | 12 ++++---- .../admin/teacher_time_report.html.twig | 2 +- .../teachers_time_by_session_report.html.twig | 30 +++++++++---------- .../default/agenda/planification.html.twig | 4 +-- .../default/auth/hrm_courses.html.twig | 2 +- .../default/auth/session_catalog.html.twig | 16 +++++----- .../main/template/default/blog/blog.html.twig | 4 +-- .../main/template/default/blog/post.html.twig | 8 ++--- .../default/course_description/edit.html.twig | 4 +-- .../course_description/upload.html.twig | 2 +- .../coursecopy/import_moodle.html.twig | 2 +- .../default/dashboard/index.html.twig | 2 +- .../default/document/recycle.html.twig | 4 +-- .../exercise/reading_comprehension.html.twig | 2 +- .../default/export/table_pdf.html.twig | 20 ++++++------- .../gamification/my_progress.html.twig | 6 ++-- .../gradebook/certificate_report.html.twig | 10 +++---- .../gradebook/my_certificates.html.twig | 18 +++++------ .../default/gradebook/search.html.twig | 24 +++++++-------- .../default/my_space/accessoverview.html.twig | 2 +- .../partials/tracking_user_overview.html.twig | 16 +++++----- .../my_space/pdf_tracking_lp.html.twig | 12 ++++---- .../default/my_space/user_summary.html.twig | 14 ++++----- .../works_in_session_report.html.twig | 14 ++++----- .../default/social/avatar_block.html.twig | 4 +-- .../default/social/form_modals.html.twig | 4 +-- .../default/social/group_view.html.twig | 4 +-- .../template/default/social/home.html.twig | 8 ++--- .../default/social/personal_data.html.twig | 4 +-- .../template/default/social/profile.html.twig | 8 ++--- .../default/social/skills_block.html.twig | 8 ++--- .../default/social/user_block.html.twig | 12 ++++---- .../default/social/whoisonline.html.twig | 2 +- .../template/default/survey/pending.html.twig | 4 +-- .../classic_courses_with_category.html.twig | 6 ++-- ...classic_courses_without_category.html.twig | 6 ++-- .../user_portal/classic_session.html.twig | 6 ++-- .../user_portal/course_categories.html.twig | 4 +-- .../grid_courses_with_category.html.twig | 6 ++-- .../grid_courses_without_category.html.twig | 10 +++---- .../user_portal/grid_session.html.twig | 10 +++---- .../user_portal/list_courses.html.twig | 6 ++-- .../user_portal/list_sessions.html.twig | 8 ++--- 46 files changed, 178 insertions(+), 178 deletions(-) diff --git a/public/main/template/default/admin/career_dashboard.html.twig b/public/main/template/default/admin/career_dashboard.html.twig index 63d713adc1..e51e54c72f 100644 --- a/public/main/template/default/admin/career_dashboard.html.twig +++ b/public/main/template/default/admin/career_dashboard.html.twig @@ -22,7 +22,7 @@ - + {% for promotions in item.career %} diff --git a/public/main/template/default/admin/gradebook_dependency.html.twig b/public/main/template/default/admin/gradebook_dependency.html.twig index 3acbff3e08..ada098fbef 100644 --- a/public/main/template/default/admin/gradebook_dependency.html.twig +++ b/public/main/template/default/admin/gradebook_dependency.html.twig @@ -8,7 +8,7 @@ ({{ gradebook_category.courseCode }}) {% endif %} - {{ 'MinimumGradebookToValidate' | get_lang }} : {{ min_to_validate }} + {{ 'Minimum to validate' | get_lang }} : {{ min_to_validate }}
{{ 'MandatoryCourses' | get_lang }} {% for course in mandatory_courses %} diff --git a/public/main/template/default/admin/gradebook_list.html.twig b/public/main/template/default/admin/gradebook_list.html.twig index 825a93e91f..9370ad6225 100644 --- a/public/main/template/default/admin/gradebook_list.html.twig +++ b/public/main/template/default/admin/gradebook_list.html.twig @@ -10,7 +10,7 @@ - + {% for item in gradebook_list %} diff --git a/public/main/template/default/admin/resource_sequence.html.twig b/public/main/template/default/admin/resource_sequence.html.twig index 422e083896..d4c3b81c12 100644 --- a/public/main/template/default/admin/resource_sequence.html.twig +++ b/public/main/template/default/admin/resource_sequence.html.twig @@ -259,7 +259,7 @@
-
{{ 'SequenceSelection' | get_lang }}
+
{{ 'Sequence selection' | get_lang }}
{{ create_sequence }} @@ -273,7 +273,7 @@
-
{{ 'SequenceConfiguration' | get_lang }}
+
{{ 'Sequence configuration' | get_lang }}
{{ configure_sequence }} @@ -283,11 +283,11 @@
-
{{ 'SequencePreview' | get_lang }}
+
{{ 'Sequence preview' | get_lang }}

- {{ 'ItemsTheReferenceDependsOn' | get_lang }} + {{ 'Items the reference depends on' | get_lang }}

@@ -300,13 +300,13 @@
-

{{ 'Dependencies' | get_lang }}

+

{{ 'Items that depend on the reference' | get_lang }}

-

{{ 'GraphDependencyTree' | get_lang }}

+

{{ 'Dependency tree' | get_lang }}

diff --git a/public/main/template/default/admin/teacher_time_report.html.twig b/public/main/template/default/admin/teacher_time_report.html.twig index 91bfedf987..756156146a 100644 --- a/public/main/template/default/admin/teacher_time_report.html.twig +++ b/public/main/template/default/admin/teacher_time_report.html.twig @@ -37,7 +37,7 @@
{% endif %} - + diff --git a/public/main/template/default/admin/teachers_time_by_session_report.html.twig b/public/main/template/default/admin/teachers_time_by_session_report.html.twig index 2ace4a8f00..2a6a614cf8 100644 --- a/public/main/template/default/admin/teachers_time_by_session_report.html.twig +++ b/public/main/template/default/admin/teachers_time_by_session_report.html.twig @@ -7,17 +7,17 @@
{{ 'Promotions' | get_lang }}{{ 'StudyCycle' | get_lang }} {{ 'Semester' | get_lang }} {{ 'Courses' | get_lang }}
{{ 'Name' | get_lang }} {{ 'Course' | get_lang }}{{ 'Actions' | get_lang }} {{ 'Detail' | get_lang }}
{{ 'Course' | get_lang }}{{ 'Coach' | get_lang }}{{ 'TotalTime' | get_lang }}{{ 'Total time' | get_lang }}
- - - - - + + + + + {% for course_code in courses %} - - - + + + {% endfor %} @@ -38,17 +38,17 @@
{{ 'OfficialCode'|get_lang }}{{ 'CoachName'|get_lang }}{{ 'TimeSpentOnThePlatform'|get_lang }}{{ 'FirstLoginInPlatform'|get_lang }}{{ 'LatestLoginInPlatform'|get_lang }}{{ 'Code'|get_lang }}{{ 'Coach name'|get_lang }}{{ 'Time spent in portal'|get_lang }}{{ 'First login in platform'|get_lang }}{{ 'Latest login in platform'|get_lang }}{{ course_code }}{{ 'NumberOfWorks'|get_lang }}{{ 'LastWork'|get_lang }}{{ 'TimeReportForCourseX'|get_lang|format(course_code) }}{{ 'Number of works'|get_lang }}{{ 'Last work'|get_lang }}{{ 'Time report for course %s'|get_lang|format(course_code) }}
- + - - - + + + {% for course in row.courses %} - - - + + + {% endfor %} diff --git a/public/main/template/default/agenda/planification.html.twig b/public/main/template/default/agenda/planification.html.twig index 56ba66e3f1..6749ec119b 100644 --- a/public/main/template/default/agenda/planification.html.twig +++ b/public/main/template/default/agenda/planification.html.twig @@ -30,7 +30,7 @@ {% for i in 1..52 %} - + {% endfor %} @@ -65,7 +65,7 @@ {% else %}
- {{ 'ThereIsNotStillASession'|get_lang }} + {{ 'There are no sessions available'|get_lang }}
{% endif %} {% endautoescape %} diff --git a/public/main/template/default/auth/hrm_courses.html.twig b/public/main/template/default/auth/hrm_courses.html.twig index 622df28bbd..81b6aacbde 100644 --- a/public/main/template/default/auth/hrm_courses.html.twig +++ b/public/main/template/default/auth/hrm_courses.html.twig @@ -9,7 +9,7 @@
{% if not user.course_list %} -
{{ 'UserHasNoCourse'|get_lang }}
+
{{ 'This user is not subscribed to any course'|get_lang }}
{% else %} {{ user.course_list }} {% endif %} diff --git a/public/main/template/default/auth/session_catalog.html.twig b/public/main/template/default/auth/session_catalog.html.twig index b97e6a8fad..3b2068a452 100644 --- a/public/main/template/default/auth/session_catalog.html.twig +++ b/public/main/template/default/auth/session_catalog.html.twig @@ -15,7 +15,7 @@
- +
@@ -30,9 +30,9 @@
- +
-
{% endfor %} {% endif %} @@ -105,7 +105,7 @@
{% if not item.sequences is empty %} @@ -128,7 +128,7 @@ {% for sequence in item.sequences %} content += '

{{ sequence.title }}

'; {% if sequence.requirements %} - content += '

{{ 'RequiredSessions'|get_lang }}

'; + content += '

{{ 'Required sessions'|get_lang }}

'; content += '
    '; {% for requirement in sequence.requirements %} @@ -141,7 +141,7 @@ {% endif %} {% if sequence.dependencies %} - content += '

    {{ 'DependentSessions'|get_lang }}

    '; + content += '

    {{ 'Dependent sessions'|get_lang }}

    '; content += '
      '; {% for dependency in sequence.dependencies %} @@ -158,7 +158,7 @@ {% endif %} {% endfor %} {% else %} - content = "{{ 'NoDependencies'|get_lang }}"; + content = "{{ 'No dependencies'|get_lang }}"; {% endif %} return content; diff --git a/public/main/template/default/blog/blog.html.twig b/public/main/template/default/blog/blog.html.twig index 226885f32b..9614ed4a93 100644 --- a/public/main/template/default/blog/blog.html.twig +++ b/public/main/template/default/blog/blog.html.twig @@ -39,7 +39,7 @@

      {{ item.extract }}

@@ -88,7 +88,7 @@
-
{{ 'MyTasks'|get_lang }}
+
{{ 'My tasks'|get_lang }}
{{ task }}
diff --git a/public/main/template/default/blog/post.html.twig b/public/main/template/default/blog/post.html.twig index 9eda67e985..45dc8acb81 100644 --- a/public/main/template/default/blog/post.html.twig +++ b/public/main/template/default/blog/post.html.twig @@ -61,7 +61,7 @@
-
+
{{ post.actions }}
@@ -78,7 +78,7 @@
  • {{ 'XComments'|get_lang|format(post.n_comments) }} + aria-hidden="true"> {{ '%s comments'|get_lang|format(post.n_comments) }}
  • @@ -102,7 +102,7 @@ {{ post.frm_rating ?: '' }}
    -

    {{ 'XComments'|get_lang|format(post.n_comments) }}

    +

    {{ '%s comments'|get_lang|format(post.n_comments) }}

    {% for item in post.comments %} {{ nested.comment_template(item) }} @@ -142,7 +142,7 @@
    -
    {{ 'MyTasks'|get_lang }}
    +
    {{ 'My tasks'|get_lang }}
    {{ task }}
    diff --git a/public/main/template/default/course_description/edit.html.twig b/public/main/template/default/course_description/edit.html.twig index 66df604b57..5e513b0d56 100644 --- a/public/main/template/default/course_description/edit.html.twig +++ b/public/main/template/default/course_description/edit.html.twig @@ -7,7 +7,7 @@ {% if is_allowed_to_edit %}
    @@ -25,7 +25,7 @@ {% if type.question %}
    - {{'QuestionPlan'|get_lang}} + {{'Help'|get_lang}}
    {{type.question}}
    diff --git a/public/main/template/default/course_description/upload.html.twig b/public/main/template/default/course_description/upload.html.twig index e830645bf2..c57f2a18db 100644 --- a/public/main/template/default/course_description/upload.html.twig +++ b/public/main/template/default/course_description/upload.html.twig @@ -6,7 +6,7 @@
    diff --git a/public/main/template/default/coursecopy/import_moodle.html.twig b/public/main/template/default/coursecopy/import_moodle.html.twig index df52049891..b2e68c48ad 100644 --- a/public/main/template/default/coursecopy/import_moodle.html.twig +++ b/public/main/template/default/coursecopy/import_moodle.html.twig @@ -10,7 +10,7 @@ diff --git a/public/main/template/default/dashboard/index.html.twig b/public/main/template/default/dashboard/index.html.twig index a5ed67e45a..bc7e538282 100644 --- a/public/main/template/default/dashboard/index.html.twig +++ b/public/main/template/default/dashboard/index.html.twig @@ -12,7 +12,7 @@ {% endfor %} {% else %} {% endif %}
    diff --git a/public/main/template/default/document/recycle.html.twig b/public/main/template/default/document/recycle.html.twig index 4ddeeaad5c..560080823a 100644 --- a/public/main/template/default/document/recycle.html.twig +++ b/public/main/template/default/document/recycle.html.twig @@ -24,7 +24,7 @@
  • - + {% for file in files %} @@ -43,6 +43,6 @@ {% endfor %}
    {{ 'OfficialCode'|get_lang }}{{ 'Code'|get_lang }} {{ 'Name'|get_lang }}{{ 'TimeSpentOnThePlatform'|get_lang }}{{ 'FirstLoginInPlatform'|get_lang }}{{ 'LatestLoginInPlatform'|get_lang }}{{ 'Time spent in portal'|get_lang }}{{ 'First login in platform'|get_lang }}{{ 'Latest login in platform'|get_lang }}{{ course.code }}{{ 'NumberOfWorks'|get_lang }}{{ 'LastWork'|get_lang }}{{ 'TimeReportForCourseX'|get_lang|format(course_code) }}{{ 'Number of works'|get_lang }}{{ 'Last work'|get_lang }}{{ 'Time report for course %s'|get_lang|format(course_code) }}
    {{ 'Session'|get_lang }}{{ i }}{{ i }}
    {{ 'Path' | get_lang }} {{ 'Size' | get_lang }}{{ 'Actions' | get_lang }}{{ 'Detail' | get_lang }}
    {% else %} - {{ 'NoData' | get_lang }} + {{ 'No data available' | get_lang }} {% endif %} diff --git a/public/main/template/default/exercise/reading_comprehension.html.twig b/public/main/template/default/exercise/reading_comprehension.html.twig index e68aefe18d..6fb34eea5b 100644 --- a/public/main/template/default/exercise/reading_comprehension.html.twig +++ b/public/main/template/default/exercise/reading_comprehension.html.twig @@ -2,7 +2,7 @@
    {% if exercise_type == 1 %} {# all in one page #} {% endif %} diff --git a/public/main/template/default/export/table_pdf.html.twig b/public/main/template/default/export/table_pdf.html.twig index 377ae82c55..16a91b5974 100644 --- a/public/main/template/default/export/table_pdf.html.twig +++ b/public/main/template/default/export/table_pdf.html.twig @@ -13,7 +13,7 @@ {% if pdf_student_info %} - {{ "Student" | get_lang }}: + {{ 'Learner' | get_lang }}: {{ pdf_student_info.complete_name }} @@ -23,7 +23,7 @@ {% if pdf_teachers %} - {{ "Teacher" | get_lang }}: + {{ 'Trainer' | get_lang }}: {{ pdf_teachers }} @@ -34,12 +34,12 @@ {% if pdf_session_info %} - {{ "Session" | get_lang }}: {{ pdf_session_info.title }} + {{ 'Session' | get_lang }}: {{ pdf_session_info.title }} {% if pdf_session_info.description %} - {{ "Description" | get_lang }}: {{ pdf_session_info.description }} + {{ 'Description' | get_lang }}: {{ pdf_session_info.description }} {% endif %} @@ -47,10 +47,10 @@ {% if pdf_session_info.access_start_date != '' and pdf_session_info.access_end_date is not empty and pdf_session_info.access_end_date != '0000-00-00' %} - {{ "PeriodToDisplay" | get_lang }}: + {{ 'Period' | get_lang }}: - {{ "FromDateXToDateY"| get_lang | format(pdf_session_info.access_start_date, pdf_session_info.access_end_date ) }} + {{ 'From %s to %s'| get_lang | format(pdf_session_info.access_start_date, pdf_session_info.access_end_date ) }} {% endif %} @@ -59,7 +59,7 @@ {% if pdf_course_info %} - {{ "Course" | get_lang }}: + {{ 'Course' | get_lang }}: {{ pdf_course_info.title }} ({{ pdf_course_info.code }}) @@ -67,7 +67,7 @@ {% if pdf_course_category is defined %} - {{ "Category" | get_lang }}: + {{ 'Category' | get_lang }}: {{ pdf_course_category }} {% endif %} @@ -76,7 +76,7 @@ {% if pdf_date %} - {{ "Date" | get_lang }}: + {{ 'Date' | get_lang }}: {{ pdf_date }} @@ -88,7 +88,7 @@ {% if show_grade_generated_date == true %}
    - {{ 'GradeGeneratedOnX' | get_lang | format("now"| date("d/m/Y")) }} + {{ 'Grade generated on %s' | get_lang | format("now"| date("d/m/Y")) }}
    {% endif %} diff --git a/public/main/template/default/gamification/my_progress.html.twig b/public/main/template/default/gamification/my_progress.html.twig index 9e33f273b6..9ba4334534 100644 --- a/public/main/template/default/gamification/my_progress.html.twig +++ b/public/main/template/default/gamification/my_progress.html.twig @@ -6,7 +6,7 @@ {{ user_avatar }}
    {{ user|user_complete_name }}
    - {{ 'XPoints'|get_lang|format(gamification_points) }} + {{ '%s points'|get_lang|format(gamification_points) }} {% if gamification_stars > 0 %} {% for i in 1..gamification_stars %} @@ -26,13 +26,13 @@ {{ gamification_progress }} Complete (success)
    -
    {{ 'XPercent'|get_lang|format(gamification_progress) }}
    +
    {{ '%s %%'|get_lang|format(gamification_progress) }}
    - {{ 'ShowProgress'|get_lang }} + {{ 'Show progress'|get_lang }}
      diff --git a/public/main/template/default/gradebook/certificate_report.html.twig b/public/main/template/default/gradebook/certificate_report.html.twig index 69048be0a4..8add5d47f1 100644 --- a/public/main/template/default/gradebook/certificate_report.html.twig +++ b/public/main/template/default/gradebook/certificate_report.html.twig @@ -36,11 +36,11 @@ $(function () { {{ search_form }} {% if not certificate_students is empty %} - + {% if not export_all_link is null %} {% endif %} @@ -48,7 +48,7 @@ $(function () { - + @@ -57,7 +57,7 @@ $(function () { - + @@ -87,7 +87,7 @@ $(function () {
      {{ 'Student' | get_lang }}{{ 'Learner' | get_lang }} {{ 'Sesion' | get_lang }} {{ 'Course' | get_lang }} {{ 'Date' | get_lang }}
      {{ 'Student' | get_lang }}{{ 'Learner' | get_lang }} {{ 'Sesion' | get_lang }} {{ 'Course' | get_lang }} {{ 'Date' | get_lang }}
      {% else %} -

      {{ 'NoResults' | get_lang }}

      +

      {{ 'No results found' | get_lang }}

      {% endif %} {% endautoescape %} diff --git a/public/main/template/default/gradebook/my_certificates.html.twig b/public/main/template/default/gradebook/my_certificates.html.twig index 608c758df8..c69eb4703a 100644 --- a/public/main/template/default/gradebook/my_certificates.html.twig +++ b/public/main/template/default/gradebook/my_certificates.html.twig @@ -1,12 +1,12 @@ {% if course_list is not empty %} - +
      - - - + + + @@ -29,15 +29,15 @@ {% endif %} {% if session_list is not empty %} - +
      {{ "Course"|get_lang }}{{ "Score"|get_lang }}{{ "Date"|get_lang }}{{ 'Course'|get_lang }}{{ 'Score'|get_lang }}{{ 'Date'|get_lang }}  
      - - - - + + + + diff --git a/public/main/template/default/gradebook/search.html.twig b/public/main/template/default/gradebook/search.html.twig index aaa51643f5..a773aa60bf 100644 --- a/public/main/template/default/gradebook/search.html.twig +++ b/public/main/template/default/gradebook/search.html.twig @@ -5,8 +5,8 @@
      {{ "Session"|get_lang }}{{ "Course"|get_lang }}{{ "Score"|get_lang }}{{ "Date"|get_lang }}{{ 'Session'|get_lang }}{{ 'Course'|get_lang }}{{ 'Score'|get_lang }}{{ 'Date'|get_lang }}  
      - - + + @@ -17,7 +17,7 @@ @@ -31,15 +31,15 @@

      {{ user_info.complete_name }}

      {% if course_list is not empty %} - +
      {{ "FirstName"|get_lang }}{{ "LastName"|get_lang }}{{ 'First name'|get_lang }}{{ 'Last name'|get_lang }}  
      {{ user.lastname }} - {{ "Certificates"|get_lang }} + {{ 'Certificates'|get_lang }}
      - - - + + + @@ -62,16 +62,16 @@ {% endif %} {% if session_list is not empty %} - +
      {{ "Course"|get_lang }}{{ "Score"|get_lang }}{{ "Date"|get_lang }}{{ 'Course'|get_lang }}{{ 'Score'|get_lang }}{{ 'Date'|get_lang }}  
      - - - - + + + + diff --git a/public/main/template/default/my_space/accessoverview.html.twig b/public/main/template/default/my_space/accessoverview.html.twig index e34f223e93..45db206582 100644 --- a/public/main/template/default/my_space/accessoverview.html.twig +++ b/public/main/template/default/my_space/accessoverview.html.twig @@ -1,7 +1,7 @@ {% autoescape false %} {{ form }} - + {{ table }}
      {{ "Session"|get_lang }}{{ "Course"|get_lang }}{{ "Score"|get_lang }}{{ "Date"|get_lang }}{{ 'Session'|get_lang }}{{ 'Course'|get_lang }}{{ 'Score'|get_lang }}{{ 'Date'|get_lang }}