summaryrefslogtreecommitdiffstats
path: root/js/public
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-15 14:44:48 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-15 14:44:48 +0200
commit01d6e6a3df56008d6fe684720e5be6de5f3ef7b2 (patch)
tree3c2b1c383ae58b585478eebcf265b1ece34b7fa7 /js/public
parentcdbafe0555fae50d7ab99f0c95573d2c3cacb97b (diff)
show real date on hover, more robust check for language support for relative dates
Diffstat (limited to 'js/public')
-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