diff options
Diffstat (limited to 'src/application/views/template_end.php')
-rw-r--r-- | src/application/views/template_end.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/application/views/template_end.php b/src/application/views/template_end.php index 7757780..c30330e 100644 --- a/src/application/views/template_end.php +++ b/src/application/views/template_end.php @@ -12,6 +12,18 @@ <script> $(function() { + var _messages = <?= json_encode([ + "selectFiles" => [ + ___("Select file", "Select files", 1), + ___("Select file", "Select files", 2), + ], + "filesSelected" => [ + ___("%n% file selected", "No files selected", 0), + ___("%n% file selected", "%n% files selected", 1), + ___("%n% file selected", "%n% files selected", 2), + ], + ]) ?> + $("._time").each(function(i, e) { var date = new Date($(e).text()); $(e).text(date.toLocaleString()); @@ -27,11 +39,11 @@ $(function() { $("input[type=file]").each(function(i, e) { var isMultiple = !!$(e).prop("multiple"); - var $input = $('<input type="text" readonly class="form-control" />').attr("placeholder", "No file" + (isMultiple ? "s" : "") + " selected"); + var $input = $('<input type="text" readonly class="form-control" />').attr("placeholder", _messages.filesSelected[0]); $(e).after($('<div class="input-group file-input-group"></div>').append( $input, $('<span class="input-group-btn"></span>').append( - $('<button class="btn btn-default" type="button"></button>').text("Select file" + (isMultiple ? "s" : "") + "...").click(function() { + $('<button class="btn btn-default" type="button"></button>').text(_messages.selectFiles[isMultiple ? 1 : 0]).click(function() { $(e).click(); }) ) @@ -43,7 +55,7 @@ $(function() { else if (files.length === 1) $input.val(files[0].name); else - $input.val(files.length + " files selected"); + $input.val(_messages.filesSelected[2].replace("%n%", files.length)); }); }) }); |