]> source.dussan.org Git - gitblit.git/commit
Revised TimeUtils for localization
authorJames Moger <james.moger@gitblit.com>
Fri, 15 Jun 2012 20:01:30 +0000 (16:01 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 15 Jun 2012 20:01:30 +0000 (16:01 -0400)
commit9adf6283b75a187b96796b892fd128e300f429a4
tree4061d1a256b020c1e3902e95210513781340e5ec
parent01774948d84794d1d9c216f9a6859d7f150815d5
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.
28 files changed:
src/com/gitblit/client/DateCellRenderer.java
src/com/gitblit/client/StatusPanel.java
src/com/gitblit/client/Translation.java
src/com/gitblit/models/IssueModel.java
src/com/gitblit/utils/TimeUtils.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/pages/BasePage.java
src/com/gitblit/wicket/pages/CommitPage.java
src/com/gitblit/wicket/pages/FederationRegistrationPage.java
src/com/gitblit/wicket/pages/LuceneSearchPage.java
src/com/gitblit/wicket/pages/MetricsPage.java
src/com/gitblit/wicket/pages/ReviewProposalPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TagPage.java
src/com/gitblit/wicket/pages/TicketPage.java
src/com/gitblit/wicket/pages/TicketsPage.java
src/com/gitblit/wicket/panels/ActivityPanel.java
src/com/gitblit/wicket/panels/BasePanel.java
src/com/gitblit/wicket/panels/BranchesPanel.java
src/com/gitblit/wicket/panels/CommitHeaderPanel.java
src/com/gitblit/wicket/panels/FederationProposalsPanel.java
src/com/gitblit/wicket/panels/FederationRegistrationsPanel.java
src/com/gitblit/wicket/panels/HistoryPanel.java
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/RepositoriesPanel.java
src/com/gitblit/wicket/panels/SearchPanel.java
src/com/gitblit/wicket/panels/TagsPanel.java
tests/com/gitblit/tests/TimeUtilsTest.java