Skip to content

Commit

Permalink
Skip s behind non-English words (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterTeng authored and blakeembrey committed Mar 3, 2017
1 parent 9b71c46 commit 1a8bf86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pluralize('test', 1) //=> "test"
pluralize('test', 5) //=> "tests"
pluralize('test', 1, true) //=> "1 test"
pluralize('test', 5, true) //=> "5 tests"
pluralize('蘋果', 2, true) //=> "2 蘋果"

pluralize.plural('regex') //=> "regexes"
pluralize.addPluralRule(/gex$/i, 'gexii')
Expand Down
1 change: 1 addition & 0 deletions pluralize.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
*/
[
[/s?$/i, 's'],
[/[^\u0000-\u007F]$/i, '$0'],
[/([^aeiou]ese)$/i, '$1'],
[/(ax|test)is$/i, '$1es'],
[/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'],
Expand Down
7 changes: 6 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,12 @@ var BASIC_TESTS = [
['camelCase', 'camelCases'],
['PascalCase', 'PascalCases'],
['Alumnus', 'Alumni'],
['CHICKEN', 'CHICKENS']
['CHICKEN', 'CHICKENS'],
['日本語', '日本語'],
['한국', '한국'],
['中文', '中文'],
['اللغة العربية', 'اللغة العربية'],
['四 chicken', '四 chickens']
];

/**
Expand Down

0 comments on commit 1a8bf86

Please sign in to comment.