Skip to content

Commit 848b307

Browse files
committed
L10N patch.
1 parent 7c0697a commit 848b307

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

assets/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Configuration defaults file (last modified: 2022.08.11).
10+
# This file: Configuration defaults file (last modified: 2022.09.22).
1111
##/
1212

1313
core:
@@ -164,6 +164,7 @@ core:
164164
ta: "தமிழ்"
165165
th: "ภาษาไทย"
166166
tr: "Türkçe"
167+
uk: "Українська"
167168
ur: "اردو"
168169
vi: "Tiếng Việt"
169170
zh: "中文(简体)"

l10n/de.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: German language data (last modified: 2022.08.18).
10+
# This file: German language data (last modified: 2022.09.22).
1111
#
1212
# Regarding translations: My native language is English. Because this is a free
1313
# and open-source hobby project which generates zero income, and translatable
@@ -36,7 +36,7 @@ detected: "Entdeckt %s"
3636
detected_control_characters: "Steuerzeichen erkannt"
3737
encrypted_archive: "Verschlüsseltes Archiv entdeckt; Verschlüsselte Archive sind nicht erlaubt"
3838
error_log_header: "Wenn einer der folgenden Fehler weiterhin auftritt, um sie zu melden oder Unterstützung zu suchen, erstellen Sie bitte eine neue Issue auf der phpMussel Issue-seite von GitHub, wenn Sie einen freien Moment haben. Fügen Sie die fraglichen Fehler zusammen mit anderen relevanten Informationen hinzu. Danke."
39-
failed_to_access: "Fehler beim Zugriff auf "%s"!"
39+
failed_to_access: "Fehler beim Zugriff auf „%s“!"
4040
field_date: "Datum"
4141
field_header_hash_reconstruction: "Rekonstruktion der Hash-Signaturen"
4242
field_header_pe_reconstruction: "Rekonstruktion der PE-Sektional-Signaturen"

src/Loader.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The loader (last modified: 2022.06.19).
11+
* This file: The loader (last modified: 2022.09.22).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -467,17 +467,25 @@ public function readFile(string $File): string
467467
*/
468468
public function readBytes(string $In, int $Mode = 0)
469469
{
470-
if (preg_match('/[KMGT][oB]$/i', $In)) {
471-
$Unit = substr($In, -2, 1);
472-
} elseif (preg_match('/[KMGToB]$/i', $In)) {
473-
$Unit = substr($In, -1);
470+
$Unit = '';
471+
if (preg_match('/([KkMmGgTtPpOoBb]|К|к|М|м|Г|г|Т|т|П|п|K|k|M|m|G|g|T|t|P|p|Б|б|B|b)([OoBb]|Б|б|B|b)?$/', $In, $Matches)) {
472+
if (preg_match('/^([Kk]|К|к)$/', $Matches[1])) {
473+
$Unit = 'K';
474+
} elseif (preg_match('/^([Mm]|М|м)$/', $Matches[1])) {
475+
$Unit = 'M';
476+
} elseif (preg_match('/^([Gg]|Г|г)$/', $Matches[1])) {
477+
$Unit = 'G';
478+
} elseif (preg_match('/^([Tt]|Т|т)$/', $Matches[1])) {
479+
$Unit = 'T';
480+
} elseif (preg_match('/^([Pp]|П|п)$/', $Matches[1])) {
481+
$Unit = 'P';
482+
}
474483
}
475-
$Unit = isset($Unit) ? strtoupper($Unit) : 'K';
476484
$In = (float)$In;
477485
if ($Mode === 1) {
478-
return $Unit === 'B' || $Unit === 'o' ? $In . 'B' : $In . $Unit . 'B';
486+
return $Unit === '' ? $In . 'B' : $In . $Unit . 'B';
479487
}
480-
$Multiply = ['K' => 1024, 'M' => 1048576, 'G' => 1073741824, 'T' => 1099511627776];
488+
$Multiply = ['K' => 1024, 'M' => 1048576, 'G' => 1073741824, 'T' => 1099511627776, 'P' => 1125899906842620];
481489
if (isset($Multiply[$Unit])) {
482490
$In *= $Multiply[$Unit];
483491
}

0 commit comments

Comments
 (0)