diff options
author | Jonas Kohl | 2024-09-16 13:27:51 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-16 13:27:51 +0200 |
commit | fd3d969cf658475709db6a1e5090069cce51cbbd (patch) | |
tree | 2fba18a3eb37803afb37117fc100cc4292ba779d /src/application/views/template_end.php | |
parent | 38f03c375eafdb6b95190729479c6fa0d721b400 (diff) |
Even more i18n
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)); }); }) }); |