Skip to content

Commit 705cd6a

Browse files
committed
Merge pull request laravel#1203 from xsbeats/bugfix/pluralizer_uncountable
Added 'traffic' and 'chassis' as uncountable words to feed pluralizer
2 parents a5bb035 + adc23dc commit 705cd6a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

application/config/strings.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
'sheep',
9797
'species',
9898
'moose',
99+
'chassis',
100+
'traffic',
99101
),
100102

101103
/*
@@ -185,4 +187,4 @@
185187

186188
),
187189

188-
);
190+
);

laravel/tests/application/config/strings.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|--------------------------------------------------------------------------
99
|
1010
| This array contains the singular and plural forms of words. It's used by
11-
| the "singular" and "plural" methods on the Str class to convert a given
11+
| the "singular" and "plural" methods in the Str class to convert a given
1212
| word from singular to plural and vice versa.
1313
|
1414
| Note that the regular expressions are only for inflecting English words.
@@ -95,6 +95,9 @@
9595
'series',
9696
'sheep',
9797
'species',
98+
'moose',
99+
'chassis',
100+
'traffic',
98101
),
99102

100103
/*
@@ -184,4 +187,4 @@
184187

185188
),
186189

187-
);
190+
);

laravel/tests/cases/str.test.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public function testStringsCanBeSingularOrPlural()
9696
$this->assertEquals('Users', Str::plural('User'));
9797
$this->assertEquals('user', Str::plural('user', 1));
9898
$this->assertEquals('users', Str::plural('user', 2));
99+
$this->assertEquals('chassis', Str::plural('chassis', 2));
100+
$this->assertEquals('traffic', Str::plural('traffic', 2));
99101
}
100102

101103
/**
@@ -130,4 +132,4 @@ public function testRandomStringsCanBeGenerated()
130132
$this->assertEquals(40, strlen(Str::random(40)));
131133
}
132134

133-
}
135+
}

0 commit comments

Comments
 (0)