Skip to content

Commit

Permalink
fixes plurals for JSON v2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamuhl committed Jan 17, 2019
1 parent a9979fb commit f033840
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
### 13.1.4

- fixes plural rule for JSON compatibility v2 introduced in 11.3.3 https://github.com/i18next/i18next/commit/d4d329fd7042f932eedf8bba1d92234707efd04c#diff-e171f9b8b4e0f5df027bd8bd7b962f1bR1140 [1174](https://github.com/i18next/i18next/issues/1174)

### 13.1.3

- TypeScript: Pull up WithT interface allowing for overrides [1172](https://github.com/i18next/i18next/pull/1172)
Expand Down
2 changes: 1 addition & 1 deletion i18next.js
Expand Up @@ -1167,7 +1167,7 @@ var PluralResolver = function () {
if (suffix === 1) return '';
if (typeof suffix === 'number') return '_plural_' + suffix.toString();
return returnSuffix();
} else if ( /* v2 */this.options.compatibilityJSON === 'v2' && rule.numbers.length === 2 && rule.numbers[0] === 1) {
} else if ( /* v2 */this.options.compatibilityJSON === 'v2') {
return returnSuffix();
} else if ( /* v3 - gettext index */this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
return returnSuffix();
Expand Down
2 changes: 1 addition & 1 deletion i18next.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "i18next",
"version": "13.1.3",
"version": "13.1.4",
"description": "i18next internationalization framework",
"main": "./index.js",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/PluralResolver.js
Expand Up @@ -144,7 +144,7 @@ class PluralResolver {
if (suffix === 1) return '';
if (typeof suffix === 'number') return `_plural_${suffix.toString()}`;
return returnSuffix();
} else if (/* v2 */ this.options.compatibilityJSON === 'v2' && (rule.numbers.length === 2 && rule.numbers[0] === 1)) {
} else if (/* v2 */ this.options.compatibilityJSON === 'v2') {
return returnSuffix();
} else if (/* v3 - gettext index */ this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
return returnSuffix();
Expand Down

0 comments on commit f033840

Please sign in to comment.