summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/models
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-06-15 16:01:30 -0400
committerJames Moger <james.moger@gitblit.com>2012-06-15 16:01:30 -0400
commit9adf6283b75a187b96796b892fd128e300f429a4 (patch)
tree4061d1a256b020c1e3902e95210513781340e5ec /src/com/gitblit/models
parent01774948d84794d1d9c216f9a6859d7f150815d5 (diff)
downloadgitblit-9adf6283b75a187b96796b892fd128e300f429a4.tar.gz
gitblit-9adf6283b75a187b96796b892fd128e300f429a4.zip
Revised TimeUtils for localization
TimeUtils needs to output localized strings like "5 days ago" and "6 months". In order to do this it needs a translation resource. Additionally, that resource can not be static because the single Gitblit server can handle multiple connections in different locales/languages. TimeUtils has changed from a collection of static methods to some static methods and some instance methods. A TimeUtils is instantiated with an optional resource bundle which contains the preferred translation. If the resourec bundle is null or the requested translation key does not exist, an English default will be used. This change required adjusting the signatures of several key methods and that cascaded out to adjusting those methods calls in many, many classes.
Diffstat (limited to 'src/com/gitblit/models')
-rw-r--r--src/com/gitblit/models/IssueModel.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/gitblit/models/IssueModel.java b/src/com/gitblit/models/IssueModel.java
index 3c191e24..c9038913 100644
--- a/src/com/gitblit/models/IssueModel.java
+++ b/src/com/gitblit/models/IssueModel.java
@@ -297,8 +297,8 @@ public class IssueModel implements Serializable, Comparable<IssueModel> {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(TimeUtils.timeAgo(created));
+ StringBuilder sb = new StringBuilder();
+ sb.append(new TimeUtils().timeAgo(created));
switch (code) {
case '+':
sb.append(" created by ");