Skip to content

Commit c5e56bb

Browse files
committed
bug symfony#54794 [Strings][EnglishInflector] Fix incorrect pluralisation of 'Album' (timporter)
This PR was submitted for the 7.0 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- [Strings][EnglishInflector] Fix incorrect pluralisation of 'Album' Previously it incorrectly returned 'Alba' for 'Album', should be 'Albums' | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT I noticed this with Platform API. Creating an Entity call "Album", for the endpoints it would generate "/api/alba/{id}', which is wrong, should be '/api/albums/{id}' Commits ------- d1c0fb6 [Strings][EnglishInflector] Fix incorrect pluralisation of 'Album'
2 parents b3baa36 + d1c0fb6 commit c5e56bb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Symfony/Component/String/Inflector/EnglishInflector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ final class EnglishInflector implements InflectorInterface
238238
// teeth (tooth)
239239
['htoot', 5, true, true, 'teeth'],
240240

241+
// albums (album)
242+
['mubla', 5, true, true, 'albums'],
243+
241244
// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
242245
['mu', 2, true, true, 'a'],
243246

src/Symfony/Component/String/Tests/Inflector/EnglishInflectorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static function singularizeProvider()
2424
['accesses', 'access'],
2525
['addresses', 'address'],
2626
['agendas', 'agenda'],
27+
['albums', 'album'],
2728
['alumnae', 'alumna'],
2829
['alumni', 'alumnus'],
2930
['analyses', ['analys', 'analyse', 'analysis']],
@@ -179,6 +180,7 @@ public static function pluralizeProvider()
179180
['address', 'addresses'],
180181
['agenda', 'agendas'],
181182
['aircraft', 'aircraft'],
183+
['album', 'albums'],
182184
['alumnus', 'alumni'],
183185
['analysis', 'analyses'],
184186
['antenna', 'antennas'], // antennae

0 commit comments

Comments
 (0)