Merge pull request #14628 from nextcloud/bugfix/14627/fix-plural-rule-detection

Fix plural rule detection for languages
This commit is contained in:
Morris Jobke 2019-03-15 10:48:26 +01:00 committed by GitHub
commit 6bc1c885b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -173,18 +173,18 @@ const L10n = {
* @private
*/
_getPlural: function(number) {
var locale = OC.getLocale();
if ('pt_BR' === locale) {
var language = OC.getLanguage();
if ('pt_BR' === language) {
// temporary set a locale for brazilian
locale = 'xbr';
language = 'xbr';
}
if (typeof locale === 'undefined') {
if (typeof language === 'undefined' || language === '') {
return (1 == number) ? 0 : 1;
}
if (locale.length > 3) {
locale = locale.substring(0, locale.lastIndexOf('_'));
if (language.length > 3) {
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).
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
*/
switch (locale) {
switch (language) {
case 'az':
case 'bo':
case 'dz':

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long