diaspora/public/javascripts/widgets/timeago.js
2011-11-07 16:33:38 +01:00

21 lines
628 B
JavaScript

/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
(function() {
Diaspora.Widgets.TimeAgo = function() {
var self = this;
this.subscribe("widget/ready", function() {
if(Diaspora.I18n.language !== "en") {
$.each($.timeago.settings.strings, function(index) {
$.timeago.settings.strings[index] = Diaspora.I18n.t("timeago." + index);
});
}
});
this.subscribe("widget/ready", function(evt, element) {
self.element = element.timeago();
});
};
})();