Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/js/l10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,26 +167,26 @@ 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('_'));
}

/*
* The plural rules are derived from code of the Zend Framework (2010-09-25),
* 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':
Expand Down