diff --git a/lib/locales/timeago.en.js b/lib/locales/timeago.en.js index a61dc0e..8709958 100644 --- a/lib/locales/timeago.en.js +++ b/lib/locales/timeago.en.js @@ -20,7 +20,8 @@ lt: "less than a", about: "about", over: "over", - almost: "almost" + almost: "almost", + ago: "" }, suffix: " ago" }; diff --git a/lib/locales/timeago.es.js b/lib/locales/timeago.es.js index 3a5d4ef..dd8c7da 100644 --- a/lib/locales/timeago.es.js +++ b/lib/locales/timeago.es.js @@ -20,7 +20,8 @@ lt: "hace menos de un", about: "cerca de", over: "poco más de", - almost: "casi" + almost: "casi", + ago: "hace " }, suffix: "" }; diff --git a/lib/locales/timeago.fr.js b/lib/locales/timeago.fr.js index 5aaf61a..f018c2b 100644 --- a/lib/locales/timeago.fr.js +++ b/lib/locales/timeago.fr.js @@ -20,7 +20,8 @@ lt: "moins d'un", about: "environ", over: "plus de ", - almost: "presque" + almost: "presque", + ago: "il y a " }, suffix: "" }; diff --git a/lib/locales/timeago.pt-br.js b/lib/locales/timeago.pt-br.js index 09bbd2c..a233c2e 100644 --- a/lib/locales/timeago.pt-br.js +++ b/lib/locales/timeago.pt-br.js @@ -20,7 +20,8 @@ lt: "menos de um", about: "aproximadamente", over: "pouco mais de", - almost: "quase" + almost: "quase", + ago: "" }, suffix: " atrás" }; diff --git a/lib/locales/timeago.zh-cn.js b/lib/locales/timeago.zh-cn.js index d483e08..1412d4a 100644 --- a/lib/locales/timeago.zh-cn.js +++ b/lib/locales/timeago.zh-cn.js @@ -20,7 +20,8 @@ lt: "不到", about: "大约", over: "超过", - almost: "接近" + almost: "接近", + ago: "" }, suffix: "之前" }; diff --git a/lib/timeago.js b/lib/timeago.js index 8e43e4f..5fb6883 100644 --- a/lib/timeago.js +++ b/lib/timeago.js @@ -2,8 +2,9 @@ // https://pragmatic.ly/ // Licensed under the MIT license. // https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE - +// // Generated by CoffeeScript 1.3.3 + (function() { var TimeAgo; @@ -83,7 +84,7 @@ TimeAgo.prototype.timeAgoInWords = function(timeString) { var absolutTime; absolutTime = this.parse(timeString); - return this.distanceOfTimeInWords(absolutTime) + ("" + this.options.lang.suffix); + return "" + this.options.lang.prefixes.ago + (this.distanceOfTimeInWords(absolutTime)) + this.options.lang.suffix; }; TimeAgo.prototype.parse = function(iso8601) { @@ -184,7 +185,8 @@ lt: "less than a", about: "about", over: "over", - almost: "almost" + almost: "almost", + ago: "" }, suffix: ' ago' } diff --git a/src/locales/timeago.en.coffee b/src/locales/timeago.en.coffee index a0a425c..98572fc 100644 --- a/src/locales/timeago.en.coffee +++ b/src/locales/timeago.en.coffee @@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang = about: "about" over: "over" almost: "almost" + ago: "" suffix: " ago" diff --git a/src/locales/timeago.es.coffee b/src/locales/timeago.es.coffee index 82d901b..8dd873f 100644 --- a/src/locales/timeago.es.coffee +++ b/src/locales/timeago.es.coffee @@ -17,5 +17,6 @@ $.fn.timeago.defaults.lang = about: "cerca de" over: "poco más de" almost: "casi" + ago: "hace " suffix: "" diff --git a/src/locales/timeago.fr.coffee b/src/locales/timeago.fr.coffee index 15db464..fcecdb7 100644 --- a/src/locales/timeago.fr.coffee +++ b/src/locales/timeago.fr.coffee @@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang = about: "environ" over: "plus de " almost: "presque" + ago: "il y a " suffix: "" diff --git a/src/locales/timeago.pt-br.coffee b/src/locales/timeago.pt-br.coffee index c85ebcd..e1361e6 100644 --- a/src/locales/timeago.pt-br.coffee +++ b/src/locales/timeago.pt-br.coffee @@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang = about: "aproximadamente" over: "pouco mais de" almost: "quase" + ago: "" suffix: " atrás" diff --git a/src/locales/timeago.zh-cn.coffee b/src/locales/timeago.zh-cn.coffee index 2803cc7..d723d75 100644 --- a/src/locales/timeago.zh-cn.coffee +++ b/src/locales/timeago.zh-cn.coffee @@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang = about: "大约" over: "超过" almost: "接近" + ago: "" suffix: "之前" diff --git a/src/timeago.coffee b/src/timeago.coffee index 103d7db..0d298eb 100644 --- a/src/timeago.coffee +++ b/src/timeago.coffee @@ -1,4 +1,4 @@ -# Smart Time Ago v0.1.0 +# Smart Time Ago v0.1.1 # Copyright 2012, Terry Tai, Pragmatic.ly # https://pragmatic.ly/ @@ -65,7 +65,7 @@ class TimeAgo timeAgoInWords: (timeString) -> absolutTime = @parse(timeString) - @distanceOfTimeInWords(absolutTime) + "#{@options.lang.suffix}" + "#{@options.lang.prefixes.ago}#{@distanceOfTimeInWords(absolutTime)}#{@options.lang.suffix}" parse: (iso8601) -> timeStr = $.trim(iso8601) @@ -147,5 +147,6 @@ $.fn.timeago.defaults = about: "about" over: "over" almost: "almost" + ago: "" suffix: ' ago'