diff options
author | James Moger <james.moger@gitblit.com> | 2012-06-15 16:01:30 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-06-15 16:01:30 -0400 |
commit | 9adf6283b75a187b96796b892fd128e300f429a4 (patch) | |
tree | 4061d1a256b020c1e3902e95210513781340e5ec /src/com/gitblit/client/DateCellRenderer.java | |
parent | 01774948d84794d1d9c216f9a6859d7f150815d5 (diff) | |
download | gitblit-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/client/DateCellRenderer.java')
-rw-r--r-- | src/com/gitblit/client/DateCellRenderer.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/gitblit/client/DateCellRenderer.java b/src/com/gitblit/client/DateCellRenderer.java index 3d0ab15b..954dad2a 100644 --- a/src/com/gitblit/client/DateCellRenderer.java +++ b/src/com/gitblit/client/DateCellRenderer.java @@ -37,7 +37,7 @@ public class DateCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = 1L;
private final String pattern;
-
+
public DateCellRenderer(String pattern, Color foreground) {
this.pattern = (pattern == null ? "yyyy-MM-dd HH:mm" : pattern);
setForeground(foreground);
@@ -55,7 +55,7 @@ public class DateCellRenderer extends DefaultTableCellRenderer { title = "--";
dateString = "never";
} else {
- title = TimeUtils.timeAgo(date);
+ title = Translation.getTimeUtils().timeAgo(date);
dateString = new SimpleDateFormat(pattern).format((Date) value);
}
|