mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
Merge pull request #14867 from nextcloud/backport/14628/stable15
[stable15] Fix plural rule detection for languages
This commit is contained in:
commit
f4cc549e86
1 changed files with 7 additions and 7 deletions
|
|
@ -167,18 +167,18 @@ OC.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('_'));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -186,7 +186,7 @@ OC.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':
|
||||
|
|
|
|||
Loading…
Reference in a new issue