Permalink
Browse files

Move the suffix to lang. and add the Chinese i18n file.

  • Loading branch information...
1 parent 164dff5 commit 5181a6ec2f4b3c04781c43622dea487d9713b21f @poshboytl poshboytl committed Aug 7, 2012
View
@@ -20,7 +20,8 @@
about: "about",
over: "over",
almost: "almost"
- }
+ },
+ suffix: 'ago'
};
}).call(this);
View
@@ -20,7 +20,8 @@
about: "cerca de",
over: "poco más de",
almost: "casi"
- }
+ },
+ suffix: ""
};
}).call(this);
View
@@ -20,7 +20,8 @@
about: "environ",
over: "plus de ",
almost: "presque"
- }
+ },
+ suffix: ""
};
}).call(this);
View
@@ -77,7 +77,7 @@
TimeAgo.prototype.timeAgoInWords = function(timeString) {
var absolutTime;
absolutTime = this.parse(timeString);
- return this.distanceOfTimeInWords(absolutTime) + (" " + this.options.suffix);
+ return this.distanceOfTimeInWords(absolutTime) + (" " + this.options.lang.suffix);
};
TimeAgo.prototype.parse = function(iso8601) {
@@ -153,7 +153,6 @@
selector: 'time.timeago',
attr: 'datetime',
dir: 'up',
- suffix: 'ago',
lang: {
units: {
second: "second",
@@ -174,7 +173,8 @@
about: "about",
over: "over",
almost: "almost"
- }
+ },
+ suffix: 'ago'
}
};
View
@@ -0,0 +1,27 @@
+(function() {
+
+ $.fn.timeago.defaults.lang = {
+ units: {
+ second: "",
+ seconds: "",
+ minute: "分钟",
+ minutes: "分钟",
+ hour: "小时",
+ hours: "小时",
+ day: "",
+ days: "",
+ month: "",
+ months: "",
+ year: "",
+ years: ""
+ },
+ prefixes: {
+ lt: "不到",
+ about: "大约",
+ over: "超过",
+ almost: "接近"
+ },
+ suffix: "之前"
+
+ }
+}).call(this);
View
@@ -128,7 +128,6 @@ $.fn.timeago.defaults =
selector: 'time.timeago'
attr: 'datetime'
dir: 'up'
- suffix: 'ago'
lang:
units:
second: "second"
@@ -148,4 +147,5 @@ $.fn.timeago.defaults =
about: "about"
over: "over"
almost: "almost"
+ suffix: 'ago'
View
@@ -17,3 +17,4 @@ $.fn.timeago.defaults.lang =
about: "about"
over: "over"
almost: "almost"
+ suffix: "ago"
View
@@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang =
about: "cerca de"
over: "poco más de"
almost: "casi"
+ suffix: ""
View
@@ -17,3 +17,4 @@ $.fn.timeago.defaults.lang =
about: "environ"
over: "plus de "
almost: "presque"
+ suffix: ""
View
@@ -0,0 +1,20 @@
+$.fn.timeago.defaults.lang =
+ units:
+ second: ""
+ seconds: ""
+ minute: "分钟"
+ minutes: "分钟"
+ hour: "小时"
+ hours: "小时"
+ day: ""
+ days: ""
+ month: ""
+ months: ""
+ year: ""
+ years: ""
+ prefixes:
+ lt: "不到"
+ about: "大约"
+ over: "超过"
+ almost: "接近"
+ suffix: "之前"

0 comments on commit 5181a6e

Please sign in to comment.