From e60c7cf08663cd0202eb8e513a24c878232f4221 Mon Sep 17 00:00:00 2001 From: mar Date: Tue, 6 Dec 2016 14:56:40 +0000 Subject: [PATCH] Add a few more pluralizers --- pluralize/cs.js | 3 +++ pluralize/de.js | 1 + pluralize/dk.js | 1 + pluralize/en.js | 5 +---- pluralize/es.js | 1 + pluralize/fr.js | 1 + pluralize/is.js | 3 +-- pluralize/it.js | 1 + pluralize/ja.js | 1 + pluralize/proto/none.js | 3 +++ pluralize/proto/p_gt_1.js | 3 +++ pluralize/proto/p_ne_1.js | 3 +++ pluralize/pt.js | 1 + pluralize/se.js | 1 + 14 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 pluralize/cs.js create mode 120000 pluralize/de.js create mode 120000 pluralize/dk.js mode change 100644 => 120000 pluralize/en.js create mode 120000 pluralize/es.js create mode 120000 pluralize/fr.js create mode 120000 pluralize/it.js create mode 120000 pluralize/ja.js create mode 100644 pluralize/proto/none.js create mode 100644 pluralize/proto/p_gt_1.js create mode 100644 pluralize/proto/p_ne_1.js create mode 120000 pluralize/pt.js create mode 120000 pluralize/se.js diff --git a/pluralize/cs.js b/pluralize/cs.js new file mode 100644 index 0000000..6a6c760 --- /dev/null +++ b/pluralize/cs.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return (n==1) ? 's' : (n>=2 && n<=4) ? 'p' : 'n' +} diff --git a/pluralize/de.js b/pluralize/de.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/de.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/dk.js b/pluralize/dk.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/dk.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/en.js b/pluralize/en.js deleted file mode 100644 index 05cce9f..0000000 --- a/pluralize/en.js +++ /dev/null @@ -1,4 +0,0 @@ -// English rules: Only 1 is singular -module.exports = function (n /*, tarnslationKey*/) { - return n !== 1 ? 'p' : 's' -} diff --git a/pluralize/en.js b/pluralize/en.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/en.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/es.js b/pluralize/es.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/es.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/fr.js b/pluralize/fr.js new file mode 120000 index 0000000..09d14f1 --- /dev/null +++ b/pluralize/fr.js @@ -0,0 +1 @@ +proto/p_gt_1.js \ No newline at end of file diff --git a/pluralize/is.js b/pluralize/is.js index b8f5d74..1a18c96 100644 --- a/pluralize/is.js +++ b/pluralize/is.js @@ -1,4 +1,3 @@ -// Icelandic rules: Numbers ending in 1 are singular - unless ending in 11. -module.exports = function (n /*, tarnslationKey*/) { +module.exports = function (n) { return (n % 10 !== 1 || n % 100 === 11) ? 'p' : 's' } diff --git a/pluralize/it.js b/pluralize/it.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/it.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/ja.js b/pluralize/ja.js new file mode 120000 index 0000000..33201a0 --- /dev/null +++ b/pluralize/ja.js @@ -0,0 +1 @@ +proto/none.js \ No newline at end of file diff --git a/pluralize/proto/none.js b/pluralize/proto/none.js new file mode 100644 index 0000000..74dab2b --- /dev/null +++ b/pluralize/proto/none.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return 'n' +} diff --git a/pluralize/proto/p_gt_1.js b/pluralize/proto/p_gt_1.js new file mode 100644 index 0000000..418d7dd --- /dev/null +++ b/pluralize/proto/p_gt_1.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n > 1 ? 'p' : 's' +} diff --git a/pluralize/proto/p_ne_1.js b/pluralize/proto/p_ne_1.js new file mode 100644 index 0000000..09220e9 --- /dev/null +++ b/pluralize/proto/p_ne_1.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n !== 1 ? 'p' : 's' +} diff --git a/pluralize/pt.js b/pluralize/pt.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/pt.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file diff --git a/pluralize/se.js b/pluralize/se.js new file mode 120000 index 0000000..661371e --- /dev/null +++ b/pluralize/se.js @@ -0,0 +1 @@ +proto/p_ne_1.js \ No newline at end of file