Skip to content

Commit 9e095ec

Browse files
Copilotjbtronics
andcommitted
Use mb_strtoupper with mb_substr for Unicode consistency
Co-authored-by: jbtronics <[email protected]>
1 parent 97f4d22 commit 9e095ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/EventListener/RegisterSynonymsAsTranslationParametersListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public function getSynonymPlaceholders(): array
6969
$placeholders['{{' . $elementType->value . '}}'] = mb_strtolower($capitalizedPlural);
7070

7171
// Square brackets for capitalized versions (with capital first letter in placeholder)
72-
$capitalizedKey = ucfirst($elementType->value);
72+
// Use mb_strtoupper for the first character to handle multibyte strings consistently
73+
$capitalizedKey = mb_strtoupper(mb_substr($elementType->value, 0, 1)) . mb_substr($elementType->value, 1);
7374
$placeholders['[' . $capitalizedKey . ']'] = $capitalizedSingular;
7475
$placeholders['[[' . $capitalizedKey . ']]'] = $capitalizedPlural;
7576
}

0 commit comments

Comments
 (0)