diff --git a/Readme.md b/Readme.md index ede0ae7..dc5342d 100644 --- a/Readme.md +++ b/Readme.md @@ -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') diff --git a/pluralize.js b/pluralize.js index 9d6afe8..d0a41a1 100644 --- a/pluralize.js +++ b/pluralize.js @@ -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'], diff --git a/test.js b/test.js index db70f5b..19396f2 100644 --- a/test.js +++ b/test.js @@ -581,7 +581,12 @@ var BASIC_TESTS = [ ['camelCase', 'camelCases'], ['PascalCase', 'PascalCases'], ['Alumnus', 'Alumni'], - ['CHICKEN', 'CHICKENS'] + ['CHICKEN', 'CHICKENS'], + ['日本語', '日本語'], + ['한국', '한국'], + ['中文', '中文'], + ['اللغة العربية', 'اللغة العربية'], + ['四 chicken', '四 chickens'] ]; /**