diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index c770374b8c..8c901c0f79 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -1372,12 +1372,22 @@ When associated with a trigger, each action is given an "order" number, specifyi 'UI:UploadNotSupportedInThisMode' => 'The modification of images or files is not supported in this mode.', // TODO: Reorganize those entries with other search entries and make entries for other languages. + // Search form 'UI:Search:Toggle' => 'Minimize / Expand', 'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Add new criteria', + // - Operators 'UI:Search:Criteria:Operator:Default:Empty' => 'Is empty', 'UI:Search:Criteria:Operator:Default:NotEmpty' => 'Is not empty', 'UI:Search:Criteria:Operator:Default:Equals' => 'Equals:', 'UI:Search:Criteria:Operator:String:Contains' => 'Contains:', 'UI:Search:Criteria:Operator:String:StartsWith' => 'Starts with:', 'UI:Search:Criteria:Operator:String:EndsWith' => 'Ends with:', + // - Criteria titles + 'UI:Search:Criteria:Title:Default:Empty' => '%1$s is empty', + 'UI:Search:Criteria:Title:Default:NotEmpty' => '%1$s is not empty', + 'UI:Search:Criteria:Title:Default:Equals' => '%1$s equals %2$s', + 'UI:Search:Criteria:Title:String:Contains' => '%1$s contains %2$s', + 'UI:Search:Criteria:Title:String:StartsWith' => '%1$s starts with %2$s', + 'UI:Search:Criteria:Title:String:EndsWith' => '%1$s ends with %2$s', + 'UI:Search:Criteria:Title:Enum:In' => '%1$s in %2$s', )); diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 908f9de97e..c440b27aa8 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -1199,4 +1199,24 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'UI:Button:ResetImage' => 'Récupérer l\'image initiale', 'UI:Button:RemoveImage' => 'Supprimer l\'image', 'UI:UploadNotSupportedInThisMode' => 'La modification d\'images ou de fichiers n\'est pas supportée dans ce mode.', + + // TODO: Reorganize those entries with other search entries and make entries for other languages. + // Search form + 'UI:Search:Toggle' => 'Réduire / Ouvrir', + 'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Ajouter un critère', + // - Operators + 'UI:Search:Criteria:Operator:Default:Empty' => 'Vide', + 'UI:Search:Criteria:Operator:Default:NotEmpty' => 'Non vide', + 'UI:Search:Criteria:Operator:Default:Equals' => 'Egal :', + 'UI:Search:Criteria:Operator:String:Contains' => 'Contient :', + 'UI:Search:Criteria:Operator:String:StartsWith' => 'Commence par :', + 'UI:Search:Criteria:Operator:String:EndsWith' => 'Fini par :', + // - Criteria titles + 'UI:Search:Criteria:Title:Default:Empty' => '%1$s vide', + 'UI:Search:Criteria:Title:Default:NotEmpty' => '%1$s non vide', + 'UI:Search:Criteria:Title:Default:Equals' => '%1$s égal %2$s', + 'UI:Search:Criteria:Title:String:Contains' => '%1$s contient %2$s', + 'UI:Search:Criteria:Title:String:StartsWith' => '%1$s commence par %2$s', + 'UI:Search:Criteria:Title:String:EndsWith' => '%1$s fini par %2$s', + 'UI:Search:Criteria:Title:Enum:In' => '%1$s parmi %2$s', )); \ No newline at end of file diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js index 67ef1c1f1d..9b74a2a951 100644 --- a/js/search/search_form_criteria.js +++ b/js/search/search_form_criteria.js @@ -440,11 +440,19 @@ $(function() { if(sTitle === undefined) { - // TODO: Make nice label - sTitle = this.options.field.label + ' ' + this.operators[this.options.operator].label + ' ' + this._getValuesAsText(); + var sOperator = this.operators[this.options.operator].code; + var sDictEntry = 'UI:Search:Criteria:Title:' + this._toCamelCase(this.options.field.widget) + ':' + this._toCamelCase(sOperator); + + // Fallback to default widget dict entry if none exists for the current widget + if(Dict.S(sDictEntry) === sDictEntry) + { + sDictEntry = 'UI:Search:Criteria:Title:Default:' + this._toCamelCase(sOperator); + } + + sTitle = Dict.Format(sDictEntry, this.options.field.label, this._getValuesAsText()); } this.element.find('.sfc_title') - .text(sTitle) + .html(sTitle) .attr('title', sTitle); },