From 4918bef4dc8a6779c6deb9084e92d24c18de0475 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 26 Apr 2016 20:21:30 +0200 Subject: [PATCH] Although there usually are no plurals in chinese, there's an exception for words related to persons, when not preceeded by a numeric word. Sources: - http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html#f3 - https://answers.yahoo.com/question/index?qid=20110606153553AAAW5zX --- js/zerobin.js | 1 + lib/i18n.php | 1 + 2 files changed, 2 insertions(+) diff --git a/js/zerobin.js b/js/zerobin.js index 7b4c8817..52979e9b 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -363,6 +363,7 @@ $(function() { switch (this.language) { case 'fr': + case 'zh': return (n > 1 ? 1 : 0); case 'pl': return (n == 1 ? 0 : n%10 >= 2 && n %10 <=4 && (n%100 < 10 || n%100 >= 20) ? 1 : 2); diff --git a/lib/i18n.php b/lib/i18n.php index 30d7d116..14e5bc50 100644 --- a/lib/i18n.php +++ b/lib/i18n.php @@ -303,6 +303,7 @@ class i18n { switch (self::$_language) { case 'fr': + case 'zh': return ($n > 1 ? 1 : 0); case 'pl': return ($n == 1 ? 0 : $n%10 >= 2 && $n %10 <=4 && ($n%100 < 10 || $n%100 >= 20) ? 1 : 2);