PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / trunk
Image Optimizer – Compress Images and Convert to WebP or AVIF vtrunk
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | modules/optimization/assets/js/utils/index.js +5 -5 1.0.0 → trunk View file →
@@ -2,20 +2,20 @@
2 2
3 3 export const formatFileSize = ( fileSizeInBytes, decimals = 2 ) => {
4 4 const sizes = [
5 5 // translators: %s: file size in bytes
6 - __( '%s Bytes', 'image-optimizer' ),
6 + __( '%s Bytes', 'image-optimization' ),
7 7 // translators: %s: file size in kilobytes
8 - __( '%s Kb', 'image-optimizer' ),
8 + __( '%s Kb', 'image-optimization' ),
9 9 // translators: %s: file size in megabytes
10 - __( '%s Mb', 'image-optimizer' ),
10 + __( '%s Mb', 'image-optimization' ),
11 11 // translators: %s: file size in gigabytes
12 - __( '%s Gb', 'image-optimizer' ),
12 + __( '%s Gb', 'image-optimization' ),
13 13 ];
14 14
15 15 if ( ! fileSizeInBytes ) {
16 16 // translators: %s: file size in bytes
17 - return sprintf( __( '%s Bytes', 'image-optimizer' ), 0 );
17 + return sprintf( __( '%s Bytes', 'image-optimization' ), 0 );
18 18 }
19 19
20 20 const currentScale = Math.floor( Math.log( fileSizeInBytes ) / Math.log( 1024 ) );
21 21 const formattedValue = parseFloat( ( fileSizeInBytes / Math.pow( 1024, currentScale ) ).toFixed( decimals ) );