Skip to content

Commit

Permalink
Update Translator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hhunderter committed Jan 14, 2025
1 parent 3ec33d4 commit f1c0c88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/libraries/Ilch/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public function trans(string $key): string
$arguments[0] = $translatedText;

// Count actual placeholders and fill missing arguments
preg_match_all('/%[bcdeEfFgGosuxX]/', $translatedText, $matches);
while (count($matches[0]) > count($arguments) - 1) {
$placeholdersCount = preg_match_all('/%(?:[bcdeEfFgGosuxX]|\d+\$[bcdeEfFgGosuxX])/i', $translatedText);
while ($placeholdersCount > count($arguments) - 1) {
$arguments[] = '';
}

Expand Down

0 comments on commit f1c0c88

Please sign in to comment.