X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/a1bcc5b88c09dcbbfb2f2ad0d509d32731ff04c3..6cffa28d6ea7ad5351d3a3bc1650fd83c61dbecc:/lib/functions.js.php?ds=sidebyside diff --git a/lib/functions.js.php b/lib/functions.js.php index 2080386..241a8e4 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -19,13 +19,13 @@ */ header('Content-Type: text/javascript'); - define('JIRAFEAU_ROOT', dirname(__FILE__) . '/../'); require(JIRAFEAU_ROOT . 'lib/settings.php'); require(JIRAFEAU_ROOT . 'lib/functions.php'); require(JIRAFEAU_ROOT . 'lib/lang.php'); ?> +// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later var web_root = ""; var lang_array = ; @@ -145,11 +145,11 @@ function show_link (reference, delete_code, crypt_key, date) // Email link var filename = document.getElementById('file_select').files[0].name; - var b = encodeURIComponent("Download file \"" + filename + "\":") + "%0D"; + var b = encodeURIComponent(" \"" + filename + "\":") + "%0D"; b += encodeURIComponent(web_root + download_link_href) + "%0D"; if (false == isEmpty(date)) { - b += "%0D" + encodeURIComponent("This file will be available until " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D"; + b += "%0D" + encodeURIComponent(": " + date.format('YYYY-MM-DD hh:mm (GMT O)')) + "%0D"; document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename); } @@ -641,38 +641,31 @@ function upload_time_estimation_speed_string() function milliseconds_to_time_string (milliseconds) { function numberEnding (number) { - var currentLanguage = ''; - - if(currentLanguage == 'de') { - return (number > 1) ? 'n' : ''; - } - else { - return (number > 1) ? 's' : ''; - } + return (number > 1) ? translate ('PLURAL_ENDING') : ''; } var temp = Math.floor(milliseconds / 1000); var years = Math.floor(temp / 31536000); if (years) { - return years + ' ' + translate ('year') + numberEnding(years); + return years + ' ' + translate ('YEAR') + numberEnding(years); } var days = Math.floor((temp %= 31536000) / 86400); if (days) { - return days + ' ' + translate ('day') + numberEnding(days); + return days + ' ' + translate ('DAY') + numberEnding(days); } var hours = Math.floor((temp %= 86400) / 3600); if (hours) { - return hours + ' ' + translate ('hour') + numberEnding(hours); + return hours + ' ' + translate ('HOUR') + numberEnding(hours); } var minutes = Math.floor((temp %= 3600) / 60); if (minutes) { - return minutes + ' ' + translate ('minute') + numberEnding(minutes); + return minutes + ' ' + translate ('MINUTE') + numberEnding(minutes); } var seconds = temp % 60; if (seconds) { - return seconds + ' ' + translate ('second') + numberEnding(seconds); + return seconds + ' ' + translate ('SECOND') + numberEnding(seconds); } - return translate ('less than a second'); + return translate ('LESS_1_SEC'); } function upload_time_estimation_time() @@ -753,3 +746,4 @@ function addCopyListener(button_id, link_id) { .addEventListener("click", function() { copyLinkToClipboard(link_id);}); } +// @license-end