浏览代码

Fix #1799: Correct translations containing `{maxSize}, {minSize}, {size}`

Kartik Visweswaran 2 年之前
父节点
当前提交
cb42fc98fb
共有 6 个文件被更改,包括 51 次插入52 次删除
  1. 2 1
      CHANGE.md
  2. 2 2
      js/locales/ar.js
  3. 2 2
      js/locales/fa.js
  4. 31 31
      js/locales/fi.js
  5. 1 1
      js/locales/fr.js
  6. 13 15
      js/plugins/buffer.js

+ 2 - 1
CHANGE.md

@@ -5,8 +5,9 @@ Change Log: `bootstrap-fileinput`
 
 **Major Release: BC Breaking**
 
-**Date**: 19-Jun-2022
+**Date**: 27-Jun-2022
 
+- (enh #1799): Correct translations containing `{maxSize}, {minSize}, {size}`.
 - (enh #1796): Add two new Font Awesome 6.x themes.
   - `fa6`
   - `explorer-fa6` 

+ 2 - 2
js/locales/ar.js

@@ -42,8 +42,8 @@
         msgPlaceholder: 'إختر {files} ...',
         msgZoomModalHeading: 'معاينة تفصيلية',
         msgFileRequired: 'يجب عليك تحديد ملف للتحميل.',
-        msgSizeTooSmall: 'الملف "{name}" (<b>{size} ك ب</b>) صغير جداً ويجب أن يكون أكبر من <b>{minSize} ك ب</b>.',
-        msgSizeTooLarge: 'الملف "{name}" (<b>{size} ك.ب</b>) تعدى الحد الأقصى المسموح للرفع <b>{maxSize} ك.ب</b>.',
+        msgSizeTooSmall: 'الملف "{name}" (<b>{size}</b>) صغير جداً ويجب أن يكون أكبر من <b>{minSize}</b>.',
+        msgSizeTooLarge: 'الملف "{name}" (<b>{size}</b>) تعدى الحد الأقصى المسموح للرفع <b>{maxSize}</b>.',
         msgFilesTooLess: 'يجب عليك اختيار <b>{n}</b> {files} على الأقل للرفع.',
         msgFilesTooMany: 'عدد الملفات المختارة للرفع <b>({n})</b> تعدت الحد الأقصى المسموح به لعدد <b>{m}</b>.',
         msgTotalFilesTooMany: 'يمكنك تحميل كحد أقصى <b>{m}</b> ملفات (<b>{n}</b> ملفات تم الكشف عنها).',

+ 2 - 2
js/locales/fa.js

@@ -42,8 +42,8 @@
         msgPlaceholder: 'انتخاب {files} ...',
         msgZoomModalHeading: 'نمایش با جزییات',
         msgFileRequired: 'شما باید یک فایل برای بارگذاری انتخاب نمایید.',
-        msgSizeTooSmall: 'فایل "{name}" (<b>{size} کیلوبایت</b>) خیلی کوچک است و باید از <b>{minSize} کیلوبایت بزرگتر باشد</b>.',
-        msgSizeTooLarge: 'فایل "{name}" (<b>{size} کیلوبایت</b>) از حداکثر مجاز <b>{maxSize} کیلوبایت</b> بزرگتر است.',
+        msgSizeTooSmall: 'فایل "{name}" (<b>{size}</b>) خیلی کوچک است و باید از <b>{minSize}</b>.',
+        msgSizeTooLarge: 'فایل "{name}" (<b>{size}</b>) از حداکثر مجاز <b>{maxSize}</b> بزرگتر است.',
         msgFilesTooLess: 'شما باید حداقل <b>{n}</b> {files} فایل برای بارگذاری انتخاب کنید.',
         msgFilesTooMany: 'تعداد فایل‌های انتخاب شده برای بارگذاری <b>({n})</b> از حداکثر مجاز عبور کرده است <b>{m}</b>.',
         msgTotalFilesTooMany: 'You can upload a maximum of <b>{m}</b> files (<b>{n}</b> files detected).',

+ 31 - 31
js/locales/fi.js

@@ -8,21 +8,21 @@
  *
  * NOTE: this file must be saved in UTF-8 encoding.
  */
-(function (factory) {
-    'use strict';
-    if (typeof define === 'function' && define.amd) {
-        define(['jquery'], factory);
-    } else if (typeof module === 'object' && typeof module.exports === 'object') {
-        factory(require('jquery'));
-    } else {
-        factory(window.jQuery);
-    }
+(function (factory) {
+    'use strict';
+    if (typeof define === 'function' && define.amd) {
+        define(['jquery'], factory);
+    } else if (typeof module === 'object' && typeof module.exports === 'object') {
+        factory(require('jquery'));
+    } else {
+        factory(window.jQuery);
+    }
 }(function ($) {
     "use strict";
 
     $.fn.fileinputLocales.fi = {
-        sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], 
-        bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
+        sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], 
+        bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
         fileSingle: 'tiedosto',
         filePlural: 'tiedostot',
         browseLabel: 'Selaa &hellip;',
@@ -35,9 +35,9 @@
         uploadLabel: 'Lataa',
         uploadTitle: 'Lataa valitut tiedostot',
         msgNoFilesSelected: '',
-        msgFileRequired: 'You must select a file to upload.',
-        msgSizeTooSmall: 'File "{name}" (<b>{size}</b>) is too small and must be larger than <b>{minSize}</b>.',
-        msgSizeTooLarge: 'Tiedosto "{name}" (<b>{size} Kt</b>) ylitt&auml;&auml; suurimman sallitun tiedoston koon, joka on <b>{maxSize} Kt</b>. Yrit&auml; uudelleen!',
+        msgFileRequired: 'You must select a file to upload.',
+        msgSizeTooSmall: 'File "{name}" (<b>{size}</b>) is too small and must be larger than <b>{minSize}</b>.',
+        msgSizeTooLarge: 'Tiedosto "{name}" (<b>{size}</b>) ylitt&auml;&auml; suurimman sallitun tiedoston koon, joka on <b>{maxSize}</b>. Yrit&auml; uudelleen!',
         msgFilesTooLess: 'V&auml;hint&auml;&auml;n <b>{n}</b> {files} tiedostoa on valittava ladattavaksi. Ole hyv&auml; ja yrit&auml; uudelleen!',
         msgFilesTooMany: 'Valittujen tiedostojen lukum&auml;&auml;r&auml; <b>({n})</b> ylitt&auml;&auml; suurimman sallitun m&auml;&auml;r&auml;n <b>{m}</b>. Ole hyv&auml; ja yrit&auml; uudelleen!',
         msgTotalFilesTooMany: 'You can upload a maximum of <b>{m}</b> files (<b>{n}</b> files detected).',
@@ -46,7 +46,7 @@
         msgFileNotReadable: 'Tiedosto "{name}" ei ole luettavissa.',
         msgFilePreviewAborted: 'Tiedoston "{name}" esikatselu keskeytetty.',
         msgFilePreviewError: 'Virhe on tapahtunut luettaessa tiedostoa "{name}".',
-        msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
+        msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
         msgInvalidFileType: 'Tiedosto "{name}" on v&auml;&auml;r&auml;n tyyppinen. Ainoastaan tiedostot tyyppi&auml; "{types}" ovat tuettuja.',
         msgInvalidFileExtension: 'Tiedoston "{name}" tarkenne on ep&auml;kelpo. Ainoastaan tarkenteet "{extensions}" ovat tuettuja.',
         msgFileTypes: {
@@ -60,44 +60,44 @@
             'object': 'Olio'
         },
         msgUploadThreshold: 'Käsitellään &hellip;',
-        msgUploadBegin: 'Initializing &hellip;',
-        msgUploadEnd: 'Done',
+        msgUploadBegin: 'Initializing &hellip;',
+        msgUploadEnd: 'Done',
         msgUploadResume: 'Resuming upload &hellip;',
         msgUploadEmpty: 'Ei ladattavaa dataa.',
-        msgUploadError: 'Upload Error',
-        msgDeleteError: 'Delete Error',
-        msgProgressError: 'Error',
+        msgUploadError: 'Upload Error',
+        msgDeleteError: 'Delete Error',
+        msgProgressError: 'Error',
         msgValidationError: 'Tiedoston latausvirhe',
         msgLoading: 'Ladataan tiedostoa {index} / {files} &hellip;',
         msgProgress: 'Ladataan tiedostoa {index} / {files} - {name} - {percent}% valmistunut.',
         msgSelected: '{n} tiedostoa valittu',
         msgFoldersNotAllowed: 'Raahaa ja pudota ainoastaan tiedostoja! Ohitettu {n} raahattua kansiota.',
-        msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',
-        msgAjaxProgressError: '{operation} failed',
+        msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',
+        msgAjaxProgressError: '{operation} failed',
         msgDuplicateFile: 'File "{name}" of same size "{size}" has already been selected earlier. Skipping duplicate selection.',
         msgResumableUploadRetriesExceeded:  'Upload aborted beyond <b>{max}</b> retries for file <b>{file}</b>! Error Details: <pre>{error}</pre>',
         msgPendingTime: '{time} remaining',
         msgCalculatingTime: 'calculating time remaining',
-        ajaxOperations: {
-            deleteThumb: 'file delete',
-            uploadThumb: 'file upload',
-            uploadBatch: 'batch file upload',
-            uploadExtra: 'form data upload'
-        },
+        ajaxOperations: {
+            deleteThumb: 'file delete',
+            uploadThumb: 'file upload',
+            uploadBatch: 'batch file upload',
+            uploadExtra: 'form data upload'
+        },
         dropZoneTitle: 'Raahaa ja pudota tiedostot t&auml;h&auml;n &hellip;',
         dropZoneClickTitle: '<br>(tai valitse hiirellä {files})',
         fileActionSettings: {
             removeTitle: 'Poista tiedosto',
             uploadTitle: 'Upload file',
-            uploadRetryTitle: 'Retry upload',
-            downloadTitle: 'Download file',
+            uploadRetryTitle: 'Retry upload',
+            downloadTitle: 'Download file',
             rotateTitle: 'Rotate 90 deg. clockwise',
             zoomTitle: 'Yksityiskohdat',
             dragTitle: 'Siirrä / Järjestele',
             indicatorNewTitle: 'Ei ladattu',
             indicatorSuccessTitle: 'Ladattu',
             indicatorErrorTitle: 'Lataus epäonnistui',
-            indicatorPausedTitle: 'Upload Paused',
+            indicatorPausedTitle: 'Upload Paused',
             indicatorLoadingTitle:  'Ladataan &hellip;'
         },
         previewZoomButtonTitles: {

+ 1 - 1
js/locales/fr.js

@@ -42,7 +42,7 @@
         msgZoomModalHeading: 'Aperçu détaillé',
         msgFileRequired: 'Vous devez sélectionner un fichier à envoyer.',
         msgSizeTooSmall: 'Le fichier "{name}" (<b>{size}</b>) est inférieur à la taille minimale de <b>{minSize}</b>.',
-        msgSizeTooLarge: 'Le fichier "{name}" (<b>{size} Ko</b>) dépasse la taille maximale autorisée qui est de <b>{maxSize} Ko</b>.',
+        msgSizeTooLarge: 'Le fichier "{name}" (<b>{size}</b>) dépasse la taille maximale autorisée qui est de <b>{maxSize}</b>.',
         msgFilesTooLess: 'Vous devez sélectionner au moins <b>{n}</b> {files} à transmettre.',
         msgFilesTooMany: 'Le nombre de fichiers sélectionnés <b>({n})</b> dépasse la quantité maximale autorisée qui est de <b>{m}</b>.',
         msgTotalFilesTooMany: 'Il n\'est pas permis d\'envoyer plus de <b>{m}</b> fichiers (actuellement <b>{n}</b> fichiers).',

+ 13 - 15
js/plugins/buffer.js

@@ -7,7 +7,8 @@
  */
 'use strict';
 
-const base64 = {
+var KrajeeBase64, KrajeeIeee754, customInspectSymbol, INSPECT_MAX_BYTES = 50, K_MAX_LENGTH = 0x7fffffff;
+KrajeeBase64 = {
     fromByteArray: function (uint8) {
         var tmp, len = uint8.length, extraBytes = len % 3, // if we have 1 byte left, pad 2 bytes
             parts = [], maxChunkLength = 16383; // must be multiple of 3
@@ -63,7 +64,7 @@ const base64 = {
         return arr;
     }
 };
-const ieee754 = {
+KrajeeIeee754 = {
     read: function (buffer, offset, isLE, mLen, nBytes) {
         var e, m, eLen = (nBytes * 8) - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7,
             i = isLE ? (nBytes - 1) : 0, d = isLE ? -1 : 1, s = buffer[offset + i];
@@ -140,13 +141,10 @@ const ieee754 = {
         buffer[offset + i - d] |= s * 128;
     }
 };
-
-const customInspectSymbol =
+customInspectSymbol =
     (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
         ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
         : null;
-const INSPECT_MAX_BYTES = 50;
-const K_MAX_LENGTH = 0x7fffffff;
 
 /**
  * If `Buffer.TYPED_ARRAY_SUPPORT`:
@@ -1076,9 +1074,9 @@ Buffer.prototype.toJSON = function toJSON() {
 
 function base64Slice(buf, start, end) {
     if (start === 0 && end === buf.length) {
-        return base64.fromByteArray(buf);
+        return KrajeeBase64.fromByteArray(buf);
     } else {
-        return base64.fromByteArray(buf.slice(start, end));
+        return KrajeeBase64.fromByteArray(buf.slice(start, end));
     }
 }
 
@@ -1502,25 +1500,25 @@ Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(off
 Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
     offset = offset >>> 0;
     if (!noAssert) checkOffset(offset, 4, this.length);
-    return ieee754.read(this, offset, true, 23, 4);
+    return KrajeeIeee754.read(this, offset, true, 23, 4);
 };
 
 Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
     offset = offset >>> 0;
     if (!noAssert) checkOffset(offset, 4, this.length);
-    return ieee754.read(this, offset, false, 23, 4);
+    return KrajeeIeee754.read(this, offset, false, 23, 4);
 };
 
 Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
     offset = offset >>> 0;
     if (!noAssert) checkOffset(offset, 8, this.length);
-    return ieee754.read(this, offset, true, 52, 8);
+    return KrajeeIeee754.read(this, offset, true, 52, 8);
 };
 
 Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
     offset = offset >>> 0;
     if (!noAssert) checkOffset(offset, 8, this.length);
-    return ieee754.read(this, offset, false, 52, 8);
+    return KrajeeIeee754.read(this, offset, false, 52, 8);
 };
 
 function checkInt(buf, value, offset, ext, max, min) {
@@ -1789,7 +1787,7 @@ function writeFloat(buf, value, offset, littleEndian, noAssert) {
     if (!noAssert) {
         checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
     }
-    ieee754.write(buf, value, offset, littleEndian, 23, 4);
+    KrajeeIeee754.write(buf, value, offset, littleEndian, 23, 4);
     return offset + 4;
 }
 
@@ -1807,7 +1805,7 @@ function writeDouble(buf, value, offset, littleEndian, noAssert) {
     if (!noAssert) {
         checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
     }
-    ieee754.write(buf, value, offset, littleEndian, 52, 8);
+    KrajeeIeee754.write(buf, value, offset, littleEndian, 52, 8);
     return offset + 8;
 }
 
@@ -2191,7 +2189,7 @@ function utf16leToBytes(str, units) {
 }
 
 function base64ToBytes(str) {
-    return base64.toByteArray(base64clean(str));
+    return KrajeeBase64.toByteArray(base64clean(str));
 }
 
 function blitBuffer(src, dst, offset, length) {