Merge pull request #14628 from nextcloud/bugfix/14627/fix-plural-rule-detection
Fix plural rule detection for languages
This commit is contained in:
commit
6bc1c885b2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -173,18 +173,18 @@ const L10n = {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_getPlural: function(number) {
|
_getPlural: function(number) {
|
||||||
var locale = OC.getLocale();
|
var language = OC.getLanguage();
|
||||||
if ('pt_BR' === locale) {
|
if ('pt_BR' === language) {
|
||||||
// temporary set a locale for brazilian
|
// temporary set a locale for brazilian
|
||||||
locale = 'xbr';
|
language = 'xbr';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof locale === 'undefined') {
|
if (typeof language === 'undefined' || language === '') {
|
||||||
return (1 == number) ? 0 : 1;
|
return (1 == number) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locale.length > 3) {
|
if (language.length > 3) {
|
||||||
locale = locale.substring(0, locale.lastIndexOf('_'));
|
language = language.substring(0, language.lastIndexOf('_'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -192,7 +192,7 @@ const L10n = {
|
||||||
* which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
|
* which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
|
||||||
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||||
*/
|
*/
|
||||||
switch (locale) {
|
switch (language) {
|
||||||
case 'az':
|
case 'az':
|
||||||
case 'bo':
|
case 'bo':
|
||||||
case 'dz':
|
case 'dz':
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue