From: James Moger Date: Mon, 26 Mar 2012 02:32:55 +0000 (-0400) Subject: Externalized a bunch of strings for translation X-Git-Tag: v0.9.0~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6caa9368cb639c14691713feb5aa16c9c0976240;p=gitblit.git Externalized a bunch of strings for translation --- diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index 5fec6e99..f4c182f6 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -36,6 +36,7 @@ Push requests to these repositories will be rejected. - Added *protect-refs.groovy* (Github/plm) - Allow setting default branch (relinking HEAD) to a branch or a tag (Github/plm) - Added Ubuntu service init script (issue 72) +- Added partial Japanese translation (Github/zakki) #### fixes diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 4300c04b..e73addc8 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -216,6 +216,8 @@ gb.workingCopy = working copy gb.workingCopyWarning = this repository has a working copy and can not receive pushes gb.query = query gb.queryHelp = Standard query syntax is supported.

Please see Lucene Query Parser Syntax for details. +gb.queryResults = results {0} - {1} ({2} hits) +gb.noHits = no hits gb.authored = authored gb.committed = committed gb.indexedBranches = indexed branches @@ -223,4 +225,49 @@ gb.indexedBranchesDescription = select the branches to include in your Lucene in gb.noIndexedRepositoriesWarning = none of your repositories are configured for Lucene indexing gb.undefinedQueryWarning = query is undefined! gb.noSelectedRepositoriesWarning = please select one or more repositories! -gb.luceneDisabled = Lucene indexing is disabled \ No newline at end of file +gb.luceneDisabled = Lucene indexing is disabled +gb.failedtoRead = Failed to read +gb.isNotValidFile = is not a valid file +gb.failedToReadMessage = Failed to read default message from {0}! +gb.passwordsDoNotMatch = Passwords do not match! +gb.passwordTooShort = Password is too short. Minimum length is {0} characters. +gb.passwordChanged = Password successfully changed. +gb.passwordChangeAborted = Password change aborted. +gb.pleaseSetRepositoryName = Please set repository name! +gb.illegalLeadingSlash = Leading root folder references (/) are prohibited. +gb.illegalRelativeSlash = Relative folder references (../) are prohibited. +gb.illegalCharacterRepositoryName = Illegal character ''{0}'' in repository name! +gb.selectAccessRestriction = Please select access restriction! +gb.selectFederationStrategy = Please select federation strategy! +gb.pleaseSetTeamName = Please enter a teamname! +gb.teamNameUnavailable = Team name ''{0}'' is unavailable. +gb.teamMustSpecifyRepository = A team must specify at least one repository. +gb.teamCreated = New team ''{0}'' successfully created. +gb.pleaseSetUsername = Please enter a username! +gb.usernameUnavailable = Username ''{0}'' is unavailable. +gb.combinedMd5Rename = Gitblit is configured for combined-md5 password hashing. You must enter a new password on account rename. +gb.userCreated = New user ''{0}'' successfully created. +gb.couldNotFindFederationRegistration = Could not find federation registration! +gb.failedToFindGravatarProfile = Failed to find Gravatar profile for {0} +gb.branchStats = {0} commits and {1} tags in {2} +gb.repositoryNotSpecified = Repository not specified! +gb.repositoryNotSpecifiedFor = Repository not specified for {0}! +gb.canNotLoadRepository = Can not load repository +gb.commitIsNull = Commit is null +gb.unauthorizedAccessForRepository = Unauthorized access for repository +gb.failedToFindCommit = Failed to find commit \"{0}\" in {1} for {2} page! +gb.couldNotFindFederationProposal = Could not find federation proposal! +gb.invalidUsernameOrPassword = Invalid username or password! +gb.OneProposalToReview = There is 1 federation proposal awaiting review. +gb.nFederationProposalsToReview = There are {0} federation proposals awaiting review. +gb.couldNotFindTag = Could not find tag {0} +gb.couldNotCreateFederationProposal = Could not create federation proposal! +gb.pleaseSetGitblitUrl = Please enter your Gitblit url! +gb.pleaseSetDestinationUrl = Please enter a destination url for your proposal! +gb.proposalReceived = Proposal successfully received by {0}. +gb.noGitblitFound = Sorry, {0} could not find a Gitblit instance at {1}. +gb.noProposals = Sorry, {0} is not accepting proposals at this time. +gb.noFederation = Sorry, {0} is not configured to federate with any Gitblit instances. +gb.proposalFailed = Sorry, {0} did not receive any proposal data! +gb.proposalError = Sorry, {0} reports that an unexpected error occurred! +gb.failedToSendProposal = Failed to send proposal! \ No newline at end of file diff --git a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties index 87bea04b..ebf19abd 100755 --- a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties @@ -131,6 +131,7 @@ gb.registrations = federation registrations gb.sendProposal = propose gb.status = status gb.origin = origin +gb.headRef = default branch (HEAD) gb.headRefDescription = HEAD \u306e\u30ea\u30f3\u30af\u5148 ref \u3092\u5909\u66f4\u3059\u308b e.g. refs/heads/master gb.federationStrategy = federation strategy gb.federationRegistration = federation registration @@ -213,3 +214,60 @@ gb.reset = \u30ea\u30bb\u30c3\u30c8 gb.pages = \u30da\u30fc\u30b8 gb.workingCopy = \u4f5c\u696d\u30b3\u30d4\u30fc gb.workingCopyWarning = \u3053\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306f\u4f5c\u696d\u30b3\u30d4\u30fc\u304c\u3042\u308b\u305f\u3081 push \u3067\u304d\u307e\u305b\u3093 +gb.query = query +gb.queryHelp = Standard query syntax is supported.

Please see Lucene Query Parser Syntax for details. +gb.queryResults = results {0} - {1} ({2} hits) +gb.noHits = no hits +gb.authored = authored +gb.committed = committed +gb.indexedBranches = indexed branches +gb.indexedBranchesDescription = select the branches to include in your Lucene index +gb.noIndexedRepositoriesWarning = none of your repositories are configured for Lucene indexing +gb.undefinedQueryWarning = query is undefined! +gb.noSelectedRepositoriesWarning = please select one or more repositories! +gb.luceneDisabled = Lucene indexing is disabled +gb.failedtoRead = Failed to read +gb.isNotValidFile = is not a valid file +gb.failedToReadMessage = Failed to read default message from {0}! +gb.passwordsDoNotMatch = Passwords do not match! +gb.passwordTooShort = Password is too short. Minimum length is {0} characters. +gb.passwordChanged = Password successfully changed. +gb.passwordChangeAborted = Password change aborted. +gb.pleaseSetRepositoryName = Please set repository name! +gb.illegalLeadingSlash = Leading root folder references (/) are prohibited. +gb.illegalRelativeSlash = Relative folder references (../) are prohibited. +gb.illegalCharacterRepositoryName = Illegal character ''{0}'' in repository name! +gb.selectAccessRestriction = Please select access restriction! +gb.selectFederationStrategy = Please select federation strategy! +gb.pleaseSetTeamName = Please enter a teamname! +gb.teamNameUnavailable = Team name ''{0}'' is unavailable. +gb.teamMustSpecifyRepository = A team must specify at least one repository. +gb.teamCreated = New team ''{0}'' successfully created. +gb.pleaseSetUsername = Please enter a username! +gb.usernameUnavailable = Username ''{0}'' is unavailable. +gb.combinedMd5Rename = Gitblit is configured for combined-md5 password hashing. You must enter a new password on account rename. +gb.userCreated = New user ''{0}'' successfully created. +gb.couldNotFindFederationRegistration = Could not find federation registration! +gb.failedToFindGravatarProfile = Failed to find Gravatar profile for {0} +gb.branchStats = {0} commits and {1} tags in {2} +gb.repositoryNotSpecified = Repository not specified! +gb.repositoryNotSpecifiedFor = Repository not specified for {0}! +gb.canNotLoadRepository = Can not load repository +gb.commitIsNull = Commit is null +gb.unauthorizedAccessForRepository = Unauthorized access for repository +gb.failedToFindCommit = Failed to find commit \"{0}\" in {1} for {2} page! +gb.couldNotFindFederationProposal = Could not find federation proposal! +gb.invalidUsernameOrPassword = Invalid username or password! +gb.OneProposalToReview = There is 1 federation proposal awaiting review. +gb.nFederationProposalsToReview = There are {0} federation proposals awaiting review. +gb.couldNotFindTag = Could not find tag {0} +gb.couldNotCreateFederationProposal = Could not create federation proposal! +gb.pleaseSetGitblitUrl = Please enter your Gitblit url! +gb.pleaseSetDestinationUrl = Please enter a destination url for your proposal! +gb.proposalReceived = Proposal successfully received by {0}. +gb.noGitblitFound = Sorry, {0} could not find a Gitblit instance at {1}. +gb.noProposals = Sorry, {0} is not accepting proposals at this time. +gb.noFederation = Sorry, {0} is not configured to federate with any Gitblit instances. +gb.proposalFailed = Sorry, {0} did not receive any proposal data! +gb.proposalError = Sorry, {0} reports that an unexpected error occurred! +gb.failedToSendProposal = Failed to send proposal! \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/ChangePasswordPage.java b/src/com/gitblit/wicket/pages/ChangePasswordPage.java index d7c774d9..5e15c8fc 100644 --- a/src/com/gitblit/wicket/pages/ChangePasswordPage.java +++ b/src/com/gitblit/wicket/pages/ChangePasswordPage.java @@ -62,7 +62,7 @@ public class ChangePasswordPage extends RootSubPage { String confirmPassword = ChangePasswordPage.this.confirmPassword.getObject(); // ensure passwords match if (!password.equals(confirmPassword)) { - error("Passwords do not match!"); + error(getString("gb.passwordsDoNotMatch")); return; } @@ -72,8 +72,7 @@ public class ChangePasswordPage extends RootSubPage { minLength = 4; } if (password.length() < minLength) { - error(MessageFormat.format( - "Password is too short. Minimum length is {0} characters.", minLength)); + error(MessageFormat.format(getString("gb.passwordTooShort"), minLength)); return; } @@ -102,7 +101,7 @@ public class ChangePasswordPage extends RootSubPage { return; } setRedirect(false); - info("Password successfully changed."); + info(getString("gb.passwordChanged")); setResponsePage(RepositoriesPage.class); } }; @@ -114,14 +113,14 @@ public class ChangePasswordPage extends RootSubPage { confirmPasswordField.setResetPassword(false); form.add(confirmPasswordField); - form.add(new Button("save")); - Button cancel = new Button("cancel") { + form.add(new Button(getString("gb.save"))); + Button cancel = new Button(getString("gb.cancel")) { private static final long serialVersionUID = 1L; @Override public void onSubmit() { setRedirect(false); - error("Password change aborted."); + error(getString("gb.passwordChangeAborted")); setResponsePage(RepositoriesPage.class); } }; diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java index c2fc9f5f..ded15455 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -158,7 +158,7 @@ public class EditRepositoryPage extends RootSubPage { try { // confirm a repository name was entered if (StringUtils.isEmpty(repositoryModel.name)) { - error("Please set repository name!"); + error(getString("gb.pleaseSetRepositoryName")); return; } @@ -169,35 +169,35 @@ public class EditRepositoryPage extends RootSubPage { // prohibit folder paths if (repositoryModel.name.startsWith("/")) { - error("Leading root folder references (/) are prohibited."); + error(getString("gb.illegalLeadingSlash")); return; } if (repositoryModel.name.startsWith("../")) { - error("Relative folder references (../) are prohibited."); + error(getString("gb.illegalRelativeSlash")); return; } if (repositoryModel.name.contains("/../")) { - error("Relative folder references (../) are prohibited."); + error(getString("gb.illegalRelativeSlash")); return; } // confirm valid characters in repository name Character c = StringUtils.findInvalidCharacter(repositoryModel.name); if (c != null) { - error(MessageFormat.format("Illegal character ''{0}'' in repository name!", + error(MessageFormat.format(getString("gb.illegalCharacterRepositoryName"), c)); return; } // confirm access restriction selection if (repositoryModel.accessRestriction == null) { - error("Please select access restriction!"); + error(getString("gb.selectAccessRestriction")); return; } // confirm federation strategy selection if (repositoryModel.federationStrategy == null) { - error("Please select federation strategy!"); + error(getString("gb.selectFederationStrategy")); return; } @@ -332,8 +332,8 @@ public class EditRepositoryPage extends RootSubPage { form.add(new BulletListPanel("inheritedPostReceive", "inherited", GitBlit.self() .getPostReceiveScriptsInherited(repositoryModel))); - form.add(new Button("save")); - Button cancel = new Button("cancel") { + form.add(new Button(getString("gb.save"))); + Button cancel = new Button(getString("gb.cancel")) { private static final long serialVersionUID = 1L; @Override diff --git a/src/com/gitblit/wicket/pages/EditTeamPage.java b/src/com/gitblit/wicket/pages/EditTeamPage.java index 2ed5fba6..feab1aa9 100644 --- a/src/com/gitblit/wicket/pages/EditTeamPage.java +++ b/src/com/gitblit/wicket/pages/EditTeamPage.java @@ -135,13 +135,13 @@ public class EditTeamPage extends RootSubPage { protected void onSubmit() { String teamname = teamModel.name; if (StringUtils.isEmpty(teamname)) { - error("Please enter a teamname!"); + error(getString("gb.pleaseSetTeamName")); return; } if (isCreate) { TeamModel model = GitBlit.self().getTeamModel(teamname); if (model != null) { - error(MessageFormat.format("Team name ''{0}'' is unavailable.", teamname)); + error(MessageFormat.format(getString("gb.teamNameUnavailable"), teamname)); return; } } @@ -151,7 +151,7 @@ public class EditTeamPage extends RootSubPage { repos.add(selectedRepositories.next().toLowerCase()); } if (repos.size() == 0) { - error("A team must specify at least one repository."); + error(getString("gb.teamMustSpecifyRepository")); return; } teamModel.repositories.clear(); @@ -206,7 +206,7 @@ public class EditTeamPage extends RootSubPage { setRedirect(false); if (isCreate) { // create another team - info(MessageFormat.format("New team ''{0}'' successfully created.", + info(MessageFormat.format(getString("gb.teamCreated"), teamModel.name)); } // back to users page @@ -232,8 +232,8 @@ public class EditTeamPage extends RootSubPage { form.add(new BulletListPanel("inheritedPostReceive", "inherited", GitBlit.self() .getPostReceiveScriptsInherited(null))); - form.add(new Button("save")); - Button cancel = new Button("cancel") { + form.add(new Button(getString("gb.save"))); + Button cancel = new Button(getString("gb.cancel")) { private static final long serialVersionUID = 1L; @Override diff --git a/src/com/gitblit/wicket/pages/EditUserPage.java b/src/com/gitblit/wicket/pages/EditUserPage.java index 3e14d083..ecc45924 100644 --- a/src/com/gitblit/wicket/pages/EditUserPage.java +++ b/src/com/gitblit/wicket/pages/EditUserPage.java @@ -110,7 +110,7 @@ public class EditUserPage extends RootSubPage { @Override protected void onSubmit() { if (StringUtils.isEmpty(userModel.username)) { - error("Please enter a username!"); + error(getString("gb.pleaseSetUsername")); return; } // force username to lower-case @@ -119,14 +119,14 @@ public class EditUserPage extends RootSubPage { if (isCreate) { UserModel model = GitBlit.self().getUserModel(username); if (model != null) { - error(MessageFormat.format("Username ''{0}'' is unavailable.", username)); + error(MessageFormat.format(getString("gb.usernameUnavailable"), username)); return; } } boolean rename = !StringUtils.isEmpty(oldName) && !oldName.equalsIgnoreCase(username); if (!userModel.password.equals(confirmPassword.getObject())) { - error("Passwords do not match!"); + error(getString("gb.passwordsDoNotMatch")); return; } String password = userModel.password; @@ -139,8 +139,7 @@ public class EditUserPage extends RootSubPage { minLength = 4; } if (password.trim().length() < minLength) { - error(MessageFormat.format( - "Password is too short. Minimum length is {0} characters.", + error(MessageFormat.format(getString("gb.passwordTooShort"), minLength)); return; } @@ -158,7 +157,7 @@ public class EditUserPage extends RootSubPage { } } else if (rename && password.toUpperCase().startsWith(StringUtils.COMBINED_MD5_TYPE)) { - error("Gitblit is configured for combined-md5 password hashing. You must enter a new password on account rename."); + error(getString("gb.combinedMd5Rename")); return; } @@ -189,7 +188,7 @@ public class EditUserPage extends RootSubPage { setRedirect(false); if (isCreate) { // create another user - info(MessageFormat.format("New user ''{0}'' successfully created.", + info(MessageFormat.format(getString("gb.userCreated"), userModel.username)); setResponsePage(EditUserPage.class); } else { @@ -216,8 +215,8 @@ public class EditUserPage extends RootSubPage { form.add(repositories); form.add(teams); - form.add(new Button("save")); - Button cancel = new Button("cancel") { + form.add(new Button(getString("gb.save"))); + Button cancel = new Button(getString("gb.cancel")) { private static final long serialVersionUID = 1L; @Override diff --git a/src/com/gitblit/wicket/pages/FederationRegistrationPage.java b/src/com/gitblit/wicket/pages/FederationRegistrationPage.java index e480eb76..751dac8f 100644 --- a/src/com/gitblit/wicket/pages/FederationRegistrationPage.java +++ b/src/com/gitblit/wicket/pages/FederationRegistrationPage.java @@ -41,7 +41,7 @@ public class FederationRegistrationPage extends RootSubPage { FederationModel registration = GitBlit.self().getFederationRegistration(url, name); if (registration == null) { - error("Could not find federation registration!", true); + error(getString("gb.couldNotFindFederationRegistration"), true); } setupPage(registration.isResultData() ? getString("gb.federationResults") diff --git a/src/com/gitblit/wicket/pages/GravatarProfilePage.java b/src/com/gitblit/wicket/pages/GravatarProfilePage.java index 0fa90095..e8a96fd1 100644 --- a/src/com/gitblit/wicket/pages/GravatarProfilePage.java +++ b/src/com/gitblit/wicket/pages/GravatarProfilePage.java @@ -49,11 +49,11 @@ public class GravatarProfilePage extends RootPage { profile = ActivityUtils.getGravatarProfile(object); } } catch (IOException e) { - error(MessageFormat.format("Failed to find Gravatar profile for {0}", object), e, true); + error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), e, true); } if (profile == null) { - error(MessageFormat.format("Failed to find Gravatar profile for {0}", object), true); + error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), true); } add(new Label("displayName", profile.displayName)); add(new Label("username", profile.preferredUsername)); diff --git a/src/com/gitblit/wicket/pages/LuceneSearchPage.java b/src/com/gitblit/wicket/pages/LuceneSearchPage.java index ea94fa43..2894add4 100644 --- a/src/com/gitblit/wicket/pages/LuceneSearchPage.java +++ b/src/com/gitblit/wicket/pages/LuceneSearchPage.java @@ -164,14 +164,14 @@ public class LuceneSearchPage extends RootPage { if (results.size() == 0) { if (!ArrayUtils.isEmpty(searchRepositories) && !StringUtils.isEmpty(query)) { add(new Label("resultsHeader", query).setRenderBodyOnly(true)); - add(new Label("resultsCount", "0 hits").setRenderBodyOnly(true)); + add(new Label("resultsCount", getString("gb.noHits")).setRenderBodyOnly(true)); } else { add(new Label("resultsHeader").setVisible(false)); add(new Label("resultsCount").setVisible(false)); } } else { add(new Label("resultsHeader", query).setRenderBodyOnly(true)); - add(new Label("resultsCount", MessageFormat.format("results {0} - {1} ({2} hits)", + add(new Label("resultsCount", MessageFormat.format(getString("gb.queryResults"), results.get(0).hitId, results.get(results.size() - 1).hitId, results.get(0).totalHits)). setRenderBodyOnly(true)); } diff --git a/src/com/gitblit/wicket/pages/MetricsPage.java b/src/com/gitblit/wicket/pages/MetricsPage.java index 7a84f76e..f6df7c51 100644 --- a/src/com/gitblit/wicket/pages/MetricsPage.java +++ b/src/com/gitblit/wicket/pages/MetricsPage.java @@ -61,7 +61,7 @@ public class MetricsPage extends RepositoryPage { add(new Label("branchStats", "")); } else { add(new Label("branchStats", - MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count, + MessageFormat.format(getString("gb.branchStats"), metricsTotal.count, metricsTotal.tag, TimeUtils.duration(metricsTotal.duration)))); } insertLinePlot("commitsChart", metrics); diff --git a/src/com/gitblit/wicket/pages/PatchPage.java b/src/com/gitblit/wicket/pages/PatchPage.java index 04934735..878cfb45 100644 --- a/src/com/gitblit/wicket/pages/PatchPage.java +++ b/src/com/gitblit/wicket/pages/PatchPage.java @@ -34,7 +34,7 @@ public class PatchPage extends WebPage { super(params); if (!params.containsKey("r")) { - GitBlitWebSession.get().cacheErrorMessage("Repository not specified!"); + GitBlitWebSession.get().cacheErrorMessage(getString("gb.repositoryNotSpecified")); redirectToInterceptPage(new RepositoriesPage()); return; } @@ -46,14 +46,14 @@ public class PatchPage extends WebPage { Repository r = GitBlit.self().getRepository(repositoryName); if (r == null) { - GitBlitWebSession.get().cacheErrorMessage("Can not load repository " + repositoryName); + GitBlitWebSession.get().cacheErrorMessage(getString("gb.canNotLoadRepository") + " " + repositoryName); redirectToInterceptPage(new RepositoriesPage()); return; } RevCommit commit = JGitUtils.getCommit(r, objectId); if (commit == null) { - GitBlitWebSession.get().cacheErrorMessage("Commit is null"); + GitBlitWebSession.get().cacheErrorMessage(getString("gb.commitIsNull")); redirectToInterceptPage(new RepositoriesPage()); return; } diff --git a/src/com/gitblit/wicket/pages/RawPage.java b/src/com/gitblit/wicket/pages/RawPage.java index c1ebea5c..f71d986f 100644 --- a/src/com/gitblit/wicket/pages/RawPage.java +++ b/src/com/gitblit/wicket/pages/RawPage.java @@ -37,7 +37,7 @@ public class RawPage extends WebPage { super(params); if (!params.containsKey("r")) { - error("Repository not specified!"); + error(getString("gb.repositoryNotSpecified")); redirectToInterceptPage(new RepositoriesPage()); } final String repositoryName = WicketUtils.getRepositoryName(params); @@ -46,7 +46,7 @@ public class RawPage extends WebPage { Repository r = GitBlit.self().getRepository(repositoryName); if (r == null) { - error("Can not load repository " + repositoryName); + error(getString("gb.canNotLoadRepository") + " " + repositoryName); redirectToInterceptPage(new RepositoriesPage()); return; } diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java index 839f4e34..40d1a652 100644 --- a/src/com/gitblit/wicket/pages/RepositoriesPage.java +++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java @@ -126,11 +126,11 @@ public class RepositoriesPage extends RootPage { message = MarkdownUtils.transformMarkdown(reader); reader.close(); } catch (Throwable t) { - message = "Failed to read " + file; + message = getString("gb.failedToRead") + " " + file; warn(message, t); } } else { - message = messageSource + " is not a valid file."; + message = messageSource + " " + getString("gb.isNotValidFile"); } } } @@ -146,7 +146,7 @@ public class RepositoriesPage extends RootPage { message = MarkdownUtils.transformMarkdown(reader); reader.close(); } catch (Throwable t) { - message = MessageFormat.format("Failed to read default message from {0}!", file); + message = MessageFormat.format(getString("gb.failedToReadMessage"), file); error(message, t, false); } return message; diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index d90d6273..3f57fbf3 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -73,7 +73,7 @@ public abstract class RepositoryPage extends BasePage { objectId = WicketUtils.getObject(params); if (StringUtils.isEmpty(repositoryName)) { - error(MessageFormat.format("Repository not specified for {0}!", getPageName()), true); + error(MessageFormat.format(getString("gb.repositoryNotSpecifiedFor"), getPageName()), true); } if (!getRepositoryModel().hasCommits) { @@ -177,7 +177,7 @@ public abstract class RepositoryPage extends BasePage { if (r == null) { Repository r = GitBlit.self().getRepository(repositoryName); if (r == null) { - error("Can not load repository " + repositoryName, true); + error(getString("gb.canNotLoadRepository") + " " + repositoryName, true); return null; } this.r = r; @@ -190,7 +190,7 @@ public abstract class RepositoryPage extends BasePage { RepositoryModel model = GitBlit.self().getRepositoryModel( GitBlitWebSession.get().getUser(), repositoryName); if (model == null) { - authenticationError("Unauthorized access for repository " + repositoryName); + authenticationError(getString("gb.unauthorizedAccessForRepository") + " " + repositoryName); return null; } m = model; @@ -201,7 +201,7 @@ public abstract class RepositoryPage extends BasePage { protected RevCommit getCommit() { RevCommit commit = JGitUtils.getCommit(r, objectId); if (commit == null) { - error(MessageFormat.format("Failed to find commit \"{0}\" in {1} for {2} page!", + error(MessageFormat.format(getString("gb.failedToFindCommit"), objectId, repositoryName, getPageName()), true); } return commit; @@ -347,7 +347,6 @@ public abstract class RepositoryPage extends BasePage { Constants.SearchType searchType = searchTypeModel.getObject(); String searchString = searchBoxModel.getObject(); if (searchString == null) { - // FIXME IE intermittently has no searchString. Wicket bug? return; } for (Constants.SearchType type : Constants.SearchType.values()) { diff --git a/src/com/gitblit/wicket/pages/ReviewProposalPage.java b/src/com/gitblit/wicket/pages/ReviewProposalPage.java index 2b095f97..25ceb65d 100644 --- a/src/com/gitblit/wicket/pages/ReviewProposalPage.java +++ b/src/com/gitblit/wicket/pages/ReviewProposalPage.java @@ -46,7 +46,7 @@ public class ReviewProposalPage extends RootSubPage { FederationProposal proposal = GitBlit.self().getPendingFederationProposal(token); if (proposal == null) { - error("Could not find federation proposal!", true); + error(getString("gb.couldNotFindFederationProposal"), true); } setupPage(getString("gb.proposals"), proposal.url); diff --git a/src/com/gitblit/wicket/pages/RootPage.java b/src/com/gitblit/wicket/pages/RootPage.java index d7b3ab73..deb2f4b4 100644 --- a/src/com/gitblit/wicket/pages/RootPage.java +++ b/src/com/gitblit/wicket/pages/RootPage.java @@ -130,11 +130,11 @@ public abstract class RootPage extends BasePage { UserModel user = GitBlit.self().authenticate(username, password); if (user == null) { - error("Invalid username or password!"); + error(getString("gb.invalidUsernameOrPassword")); } else if (user.username.equals(Constants.FEDERATION_USER)) { // disallow the federation user from logging in via the // web ui - error("Invalid username or password!"); + error(getString("gb.invalidUsernameOrPassword")); user = null; } else { loginUser(user); @@ -162,9 +162,9 @@ public abstract class RootPage extends BasePage { } else if (showAdmin) { int pendingProposals = GitBlit.self().getPendingFederationProposals().size(); if (pendingProposals == 1) { - info("There is 1 federation proposal awaiting review."); + info(getString("gb.OneProposalToReview")); } else if (pendingProposals > 1) { - info(MessageFormat.format("There are {0} federation proposals awaiting review.", + info(MessageFormat.format(getString("gb.nFederationProposalsToReview"), pendingProposals)); } } diff --git a/src/com/gitblit/wicket/pages/SendProposalPage.java b/src/com/gitblit/wicket/pages/SendProposalPage.java index a7fcadcf..e97a090f 100644 --- a/src/com/gitblit/wicket/pages/SendProposalPage.java +++ b/src/com/gitblit/wicket/pages/SendProposalPage.java @@ -59,7 +59,7 @@ public class SendProposalPage extends RootSubPage { // temporary proposal FederationProposal proposal = GitBlit.self().createFederationProposal(myUrl, token); if (proposal == null) { - error("Could not create federation proposal!", true); + error(getString("gb.couldNotCreateFederationProposal"), true); } CompoundPropertyModel model = new CompoundPropertyModel( @@ -72,11 +72,11 @@ public class SendProposalPage extends RootSubPage { protected void onSubmit() { // confirm a repository name was entered if (StringUtils.isEmpty(myUrl)) { - error("Please enter your Gitblit url!"); + error(getString("gb.pleaseSetGitblitUrl")); return; } if (StringUtils.isEmpty(destinationUrl)) { - error("Please enter a destination url for your proposal!"); + error(getString("gb.pleaseSetDestinationUrl")); return; } @@ -89,32 +89,29 @@ public class SendProposalPage extends RootSubPage { .propose(destinationUrl, proposal); switch (res) { case ACCEPTED: - info(MessageFormat.format("Proposal successfully received by {0}.", + info(MessageFormat.format(getString("gb.proposalReceived"), destinationUrl)); setResponsePage(RepositoriesPage.class); break; case NO_POKE: - error(MessageFormat.format( - "Sorry, {0} could not find a Gitblit instance at {1}.", + error(MessageFormat.format(getString("noGitblitFound"), destinationUrl, myUrl)); break; case NO_PROPOSALS: - error(MessageFormat.format( - "Sorry, {0} is not accepting proposals at this time.", + error(MessageFormat.format(getString("gb.noProposals"), destinationUrl)); break; case FEDERATION_DISABLED: error(MessageFormat - .format("Sorry, {0} is not configured to federate with any Gitblit instances.", + .format(getString("gb.noFederation"), destinationUrl)); break; case MISSING_DATA: - error(MessageFormat.format("Sorry, {0} did not receive any proposal data!", + error(MessageFormat.format(getString("gb.proposalFailed"), destinationUrl)); break; case ERROR: - error(MessageFormat.format( - "Sorry, {0} reports that an unexpected error occurred!", + error(MessageFormat.format(getString("gb.proposalError"), destinationUrl)); break; } @@ -122,7 +119,7 @@ public class SendProposalPage extends RootSubPage { if (!StringUtils.isEmpty(e.getMessage())) { error(e.getMessage()); } else { - error("Failed to send proposal!"); + error(getString("gb.failedToSendProposal")); } } } @@ -133,8 +130,8 @@ public class SendProposalPage extends RootSubPage { form.add(new Label("tokenType", proposal.tokenType.name())); form.add(new Label("token", proposal.token)); - form.add(new Button("save")); - Button cancel = new Button("cancel") { + form.add(new Button(getString("gb.save"))); + Button cancel = new Button(getString("gb.cancel")) { private static final long serialVersionUID = 1L; @Override diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 7e8995ed..2996b662 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -89,7 +89,7 @@ public class SummaryPage extends RepositoryPage { add(new Label("branchStats", "")); } else { add(new Label("branchStats", - MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count, + MessageFormat.format(getString("gb.branchStats"), metricsTotal.count, metricsTotal.tag, TimeUtils.duration(metricsTotal.duration)))); } add(new BookmarkablePageLink("metrics", MetricsPage.class, diff --git a/src/com/gitblit/wicket/pages/TagPage.java b/src/com/gitblit/wicket/pages/TagPage.java index acdd77f3..b7a53747 100644 --- a/src/com/gitblit/wicket/pages/TagPage.java +++ b/src/com/gitblit/wicket/pages/TagPage.java @@ -51,7 +51,7 @@ public class TagPage extends RepositoryPage { // Failed to find tag! if (tagRef == null) { - error(MessageFormat.format("Could not find tag {0}", objectId), true); + error(MessageFormat.format(getString("gb.couldNotFindTag"), objectId), true); } // Display tag.