Browse Source

Translation for one char

Laurent Destailleur 9 years ago
parent
commit
a83a291856
2 changed files with 5 additions and 1 deletions
  1. 4 1
      htdocs/core/js/select2_locale.js.php
  2. 1 0
      htdocs/langs/en_US/main.lang

+ 4 - 1
htdocs/core/js/select2_locale.js.php

@@ -52,7 +52,10 @@ else header('Cache-Control: no-cache');
     $.fn.select2.locales['xx'] = {
         formatMatches: function (matches) { return matches + " <?php echo dol_escape_js($langs->trans("Select2ResultFoundUseArrows")); ?>"; },
         formatNoMatches: function () { return "<?php echo dol_escape_js($langs->trans("Select2NotFound")); ?>"; },
-        formatInputTooShort: function (input, min) { var n = min - input.length; return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>"; },
+        formatInputTooShort: function (input, min) { var n = min - input.length; 
+        	if (n > 1) return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>"; 
+        	else return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacter")); ?>"
+        	},
         formatLoadMore: function (pageNumber) { return "<?php echo dol_escape_js($langs->trans("Select2LoadingMoreResults")); ?>"; },
         formatSearching: function () { return "<?php echo dol_escape_js($langs->trans("Select2SearchInProgress")); ?>"; }
     };

+ 1 - 0
htdocs/langs/en_US/main.lang

@@ -784,6 +784,7 @@ SetRef=Set ref
 Select2ResultFoundUseArrows=
 Select2NotFound=No result found
 Select2Enter=Enter
+Select2MoreCharacter=or more character
 Select2MoreCharacters=or more characters
 Select2LoadingMoreResults=Loading more results...
 Select2SearchInProgress=Search in progress...