summaryrefslogtreecommitdiffstats
path: root/js/public/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/public/app.js')
-rw-r--r--js/public/app.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/js/public/app.js b/js/public/app.js
index f9ae29d48..df081ffb7 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -1399,16 +1399,26 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
+ var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
angular.module('News').factory('Language', function() {
var Language;
Language = (function() {
function Language() {
this._language = 'en';
+ this._langs = ['ar-ma', 'ar', 'bg', 'ca', 'cs', 'cv', 'da', 'de', 'el', 'en-ca', 'en-gb', 'eo', 'es', 'et', 'eu', 'fi', 'fr-ca', 'fr', 'gl', 'he', 'hi', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'ko', 'lv', 'ms-my', 'nb', 'ne', 'nl', 'pl', 'pt-br', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'tzm-la', 'tzm', 'uk', 'zh-cn', 'zh-tw'];
}
Language.prototype.handle = function(data) {
- return this._language = data.split('_')[0];
+ data = data.replace('_', '-').toLowerCase();
+ if (!(__indexOf.call(this._langs, data) >= 0)) {
+ data = data.split('-')[0];
+ }
+ if (!(__indexOf.call(this._langs, data) >= 0)) {
+ data = 'en';
+ }
+ return this._language = data;
};
Language.prototype.getLanguage = function() {
@@ -1937,12 +1947,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
// Generated by CoffeeScript 1.6.2
-(function() {
-
-
-}).call(this);
-
-// Generated by CoffeeScript 1.6.2
/*
ownCloud - News