From 75cdb0208ea8abdb5f4a04c73267c2fe2f26d6af Mon Sep 17 00:00:00 2001 From: Myriam Delaruelle <myriam.delaruelle@univ-lorraine.fr> Date: Tue, 15 Oct 2024 09:33:08 +0200 Subject: [PATCH] added translation --- amd/build/suivi.js | 14 ++++++++------ lang/en/format_iena.php | 11 ++++++++++- lang/fr/format_iena.php | 13 ++++++++++++- templates/suivi.mustache | 36 ++++++++---------------------------- 4 files changed, 38 insertions(+), 36 deletions(-) diff --git a/amd/build/suivi.js b/amd/build/suivi.js index 2a8c5a4..bca339d 100644 --- a/amd/build/suivi.js +++ b/amd/build/suivi.js @@ -85,8 +85,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], } else { $('.group-option').prop('checked', false); displayTotalGroupsFilter(); - changeGroup(); + } + changeGroup(); }); }, initTable:function(){ @@ -144,7 +145,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], groupsid.push(groupscheckboxes[i].value); } loadMessage("loading"); - + if(groupsid.length==0){ + groupsid.push(-2); + } $.ajax({ url: completeUrl, data: {action: 'fetchgroups', groupsid:groupsid}, type: 'post', @@ -652,8 +655,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], function checkAllGroupsFilter(){ $('.selectallgroups').prop('checked', true); $('.group-option').prop('checked', true); - console.log("on check bien tout du coup ?"); - changeGroup(); + //changeGroup(); $(".select-text").html(' Deselect'); } @@ -663,13 +665,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'], function displayTotalGroupsFilter(){ var total = $('input[name="groupoptions[]"]:checked').length; if(total == $('input[name="groupoptions[]"]').length){ - var message=str.get_string('allActivities', 'format_iena'); + var message=str.get_string('allGroups', 'format_iena'); $.when(message).done(function(localizedEditString) { $(".dropdown-text-group").html(localizedEditString); }); } else{ - var message=str.get_string('selectedActivities', 'format_iena'); + var message=str.get_string('selectedGroups', 'format_iena'); $.when(message).done(function(localizedEditString) { $(".dropdown-text-group").html(total + ' '+localizedEditString); }); diff --git a/lang/en/format_iena.php b/lang/en/format_iena.php index f89c03e..342a03f 100644 --- a/lang/en/format_iena.php +++ b/lang/en/format_iena.php @@ -109,4 +109,13 @@ $string['display_groups_help']="Add a column to the table which display the stud $string['display_custom_help']="This option enables the table customization and allows you to add colors to certain activities (just for you), or to define milestones (for all teachers in the course)"; $string['display_details_help']="this option allows you to have the details of an assessment on click: grade, date of evaluation, evaluator, etc."; $string['display_status_help']="This option adds a new status \"Waiting for an evaluation from me\" which allows you to identify which activities have been completed by the student and require action from the teacher"; -$string['cachedef_students'] = 'Students list'; \ No newline at end of file +$string['cachedef_students'] = 'Students list'; +$string['selectedGroups']="selected"; +$string['allGroups']="All"; +$string['allGroupsLabel']="All groups"; +$string['withoutGroup']="Without groups"; +$string['allActivitiesLabel']="All activities"; +$string['completion']="completion"; +$string['filter']="Filter"; +$string['messagesSent']="Messages sent"; +$string['messagesNotSent']="An error occured: the messages could not be sent"; \ No newline at end of file diff --git a/lang/fr/format_iena.php b/lang/fr/format_iena.php index a12c05c..32e9d09 100644 --- a/lang/fr/format_iena.php +++ b/lang/fr/format_iena.php @@ -109,4 +109,15 @@ $string['display_groups_help']="Cette option ajoute une colonne dans le tableau $string['display_custom_help']="Cette option active la personnalisation du tableau et permet d'ajouter des couleurs à certaines activités (personnel), ou de définir des jalons (pour tous les enseignants du cours)"; $string['display_details_help']="Cette option permet à l'enseignant d'avoir les détails d'une évaluation au clic : note, date de l'évaluation, évaluateur..."; $string['display_status_help']="Cette option ajoute un statut 'En attente d'évaluation de ma part qui permet de repérer quelles activités ont été complétées par l'étudiant et nécessite une action de la part de l'enseignant"; -$string['cachedef_students'] = 'La liste des étudiants du cours'; \ No newline at end of file +$string['cachedef_students'] = 'La liste des étudiants du cours'; +$string['selectedGroups']="sélectionné(s)"; +$string['allGroups']="Tous"; +$string['allGroupsLabel']="Tous les groupes"; +$string['withoutGroup']="Sans groupe"; +$string['allActivitiesLabel']="Toutes les activités"; +$string['completion']="achèvement"; +$string['filter']="Filtre"; +$string['messagesSent']="Message(s) envoyé(s)"; +$string['messagesNotSent']="Une erreur s'est produite : le()s message(s) n'ont pas été envoyé(s)"; + + diff --git a/templates/suivi.mustache b/templates/suivi.mustache index 6e0699a..0e84aa4 100644 --- a/templates/suivi.mustache +++ b/templates/suivi.mustache @@ -20,7 +20,7 @@ <a href="{{link_classicview}}" class="" role="menuitem"><i class="icon fa fa-pencil fa-fw " aria-hidden="true"></i>Vue classique</a> </div> <div class="dropdown-item"> - <a href="{{link_editview}}" class="" role="menuitem"><i class="icon fa fa-pencil fa-fw " aria-hidden="true"></i>Paramètres du tableau</a> + <a href="{{link_editview}}" class="" role="menuitem"><i class="icon fa fa-eye fa-fw " aria-hidden="true"></i>Paramètres du tableau</a> </div> </div> </div> @@ -56,7 +56,7 @@ <span class="caret"></span></button> <ul class="dropdown-menu dropdown-menu-form" id="iena-activities-dropdown"> <li><label class="checkbox"> - <input type="checkbox" class="selectallactivities" checked value='all'>Toutes les activités</label></li> + <input type="checkbox" class="selectallactivities" checked value='all'>{{# str }} allActivitiesLabel, format_iena {{/ str}}</label></li> <li class="divider"></li> <ul class="iena-dynamic-activities"> {{#modules}} @@ -82,13 +82,13 @@ <ul class="dropdown-menu dropdown-menu-form" id="iena-group-dropdown"> <li> <label class="checkbox"> - <input type="checkbox" class="selectallgroups" checked value='0' {{default_group}}>Tous les groupes</label> + <input type="checkbox" class="selectallgroups" checked value='0' {{default_group}}>{{# str }} allGroupsLabel, format_iena {{/ str}}</label> </li> <li class="divider"></li> <li> <label class="checkbox"> - <input type="checkbox" class="selectwithoutgroups group-option justone-group" name="groupoptions[]" value='-1'>Sans groupe</label> + <input type="checkbox" class="selectwithoutgroups group-option justone-group" name="groupoptions[]" value='-1'>{{# str }} withoutGroup, format_iena {{/ str}}</label> </li> <optgroup label="Mes groupes"> </optgroup> @@ -111,33 +111,13 @@ </div> - <!--<select class="custom-select mr-sm-2" id="group-select" name="groupid"> - - <option value="0" {{default_group}}>Tous</option> - - <optgroup label="Mes groupes"> - {{#current_user_groups}} - <option {{selected}} value='{{id}}'>{{name}}</option>"; - {{/current_user_groups}} - </optgroup> - - <optgroup label="Autres groupes"> - {{#othergroups}} - <option {{selected}} value='{{id}}'>{{name}}</option>"; - - {{/othergroups}} - </optgroup> - - - - </select>--> </div> - <label class="sr-only" for="filter-select">Filtre %</label> + <label class="sr-only" for="filter-select">{{# str }} filter, format_iena {{/ str}} %</label> <div class="input-group"> <div class="input-group-prepend"> - <div class="input-group-text">% achèvement</div> + <div class="input-group-text">% {{# str }} completion, format_iena {{/ str}}</div> </div> <select class="custom-select mr-sm-2" id="symbol-select" name="filter"> @@ -156,10 +136,10 @@ </div> </form> {{#msg_success}} - <div class="alert alert-success iena-message">Message(s) envoyé(s)</div> + <div class="alert alert-success iena-message">{{# str }} messagesSent, format_iena {{/ str}}</div> {{/msg_success}} {{#msg_failure}} - <div class="alert alert-danger iena-message">Messages non envoyés</div> + <div class="alert alert-danger iena-message">{{# str }} messagesNotSent, format_iena {{/ str}}</div> {{/msg_failure}} <div id="caption-iena"><h5>{{# str }} caption, format_iena {{/ str}}</h5> <div class="caption-wrapper"> -- GitLab