diff --git a/core/js/l10n.js b/core/js/l10n.js index 6027d42dca05d..a6cec1401ee3a 100644 --- a/core/js/l10n.js +++ b/core/js/l10n.js @@ -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':