From 6caa9368cb639c14691713feb5aa16c9c0976240 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 25 Mar 2012 22:32:55 -0400
Subject: [PATCH] Externalized a bunch of strings for translation

---
 src/com/gitblit/wicket/pages/LuceneSearchPage.java           |    4 
 src/com/gitblit/wicket/pages/RepositoriesPage.java           |    6 
 src/com/gitblit/wicket/pages/EditRepositoryPage.java         |   18 +-
 src/com/gitblit/wicket/pages/EditUserPage.java               |   17 +-
 src/com/gitblit/wicket/pages/FederationRegistrationPage.java |    2 
 src/com/gitblit/wicket/pages/PatchPage.java                  |    6 
 src/com/gitblit/wicket/pages/RepositoryPage.java             |    9 -
 src/com/gitblit/wicket/pages/ReviewProposalPage.java         |    2 
 src/com/gitblit/wicket/pages/SendProposalPage.java           |   27 ++---
 src/com/gitblit/wicket/pages/MetricsPage.java                |    2 
 src/com/gitblit/wicket/GitBlitWebApp.properties              |   49 +++++++++
 src/com/gitblit/wicket/GitBlitWebApp_ja.properties           |   58 +++++++++++
 src/com/gitblit/wicket/pages/EditTeamPage.java               |   12 +-
 src/com/gitblit/wicket/pages/RawPage.java                    |    4 
 docs/04_releases.mkd                                         |    1 
 src/com/gitblit/wicket/pages/ChangePasswordPage.java         |   13 +-
 src/com/gitblit/wicket/pages/GravatarProfilePage.java        |    4 
 src/com/gitblit/wicket/pages/RootPage.java                   |    8 
 src/com/gitblit/wicket/pages/SummaryPage.java                |    2 
 src/com/gitblit/wicket/pages/TagPage.java                    |    2 
 20 files changed, 173 insertions(+), 73 deletions(-)

diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd
index 5fec6e9..f4c182f 100644
--- a/docs/04_releases.mkd
+++ b/docs/04_releases.mkd
@@ -36,6 +36,7 @@
 - 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 4300c04..e73addc 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -216,6 +216,8 @@
 gb.workingCopyWarning = this repository has a working copy and can not receive pushes
 gb.query = query
 gb.queryHelp = Standard query syntax is supported.<p/><p/>Please see <a target="_new" href="http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html">Lucene Query Parser Syntax</a> 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.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 87bea04..ebf19ab 100755
--- a/src/com/gitblit/wicket/GitBlitWebApp_ja.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp_ja.properties
@@ -131,6 +131,7 @@
 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.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.<p/><p/>Please see <a target="_new" href="http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html">Lucene Query Parser Syntax</a> 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 d7c774d..5e15c8f 100644
--- a/src/com/gitblit/wicket/pages/ChangePasswordPage.java
+++ b/src/com/gitblit/wicket/pages/ChangePasswordPage.java
@@ -62,7 +62,7 @@
 				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 @@
 					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 @@
 					return;
 				}
 				setRedirect(false);
-				info("Password successfully changed.");
+				info(getString("gb.passwordChanged"));
 				setResponsePage(RepositoriesPage.class);
 			}
 		};
@@ -114,14 +113,14 @@
 		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 c2fc9f5..ded1545 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -158,7 +158,7 @@
 				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 @@
 
 					// 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 @@
 		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 2ed5fba..feab1aa 100644
--- a/src/com/gitblit/wicket/pages/EditTeamPage.java
+++ b/src/com/gitblit/wicket/pages/EditTeamPage.java
@@ -135,13 +135,13 @@
 			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 @@
 					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 @@
 				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 @@
 		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 3e14d08..ecc4592 100644
--- a/src/com/gitblit/wicket/pages/EditUserPage.java
+++ b/src/com/gitblit/wicket/pages/EditUserPage.java
@@ -110,7 +110,7 @@
 			@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 @@
 				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 @@
 						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 @@
 					}
 				} 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 @@
 				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 @@
 		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 e480eb7..751dac8 100644
--- a/src/com/gitblit/wicket/pages/FederationRegistrationPage.java
+++ b/src/com/gitblit/wicket/pages/FederationRegistrationPage.java
@@ -41,7 +41,7 @@
 
 		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 0fa9009..e8a96fd 100644
--- a/src/com/gitblit/wicket/pages/GravatarProfilePage.java
+++ b/src/com/gitblit/wicket/pages/GravatarProfilePage.java
@@ -49,11 +49,11 @@
 				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 ea94fa4..2894add 100644
--- a/src/com/gitblit/wicket/pages/LuceneSearchPage.java
+++ b/src/com/gitblit/wicket/pages/LuceneSearchPage.java
@@ -164,14 +164,14 @@
 		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 7a84f76..f6df7c5 100644
--- a/src/com/gitblit/wicket/pages/MetricsPage.java
+++ b/src/com/gitblit/wicket/pages/MetricsPage.java
@@ -61,7 +61,7 @@
 			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 0493473..878cfb4 100644
--- a/src/com/gitblit/wicket/pages/PatchPage.java
+++ b/src/com/gitblit/wicket/pages/PatchPage.java
@@ -34,7 +34,7 @@
 		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 @@
 
 		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 c1ebea5..f71d986 100644
--- a/src/com/gitblit/wicket/pages/RawPage.java
+++ b/src/com/gitblit/wicket/pages/RawPage.java
@@ -37,7 +37,7 @@
 		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 @@
 
 		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 839f4e3..40d1a65 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java
@@ -126,11 +126,11 @@
 						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 @@
 			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 d90d627..3f57fbf 100644
--- a/src/com/gitblit/wicket/pages/RepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -73,7 +73,7 @@
 		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 @@
 		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 @@
 			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 @@
 	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 @@
 			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 2b095f9..25ceb65 100644
--- a/src/com/gitblit/wicket/pages/ReviewProposalPage.java
+++ b/src/com/gitblit/wicket/pages/ReviewProposalPage.java
@@ -46,7 +46,7 @@
 
 		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 d7b3ab7..deb2f4b 100644
--- a/src/com/gitblit/wicket/pages/RootPage.java
+++ b/src/com/gitblit/wicket/pages/RootPage.java
@@ -130,11 +130,11 @@
 
 				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 @@
 		} 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 a7fcadc..e97a090 100644
--- a/src/com/gitblit/wicket/pages/SendProposalPage.java
+++ b/src/com/gitblit/wicket/pages/SendProposalPage.java
@@ -59,7 +59,7 @@
 		// 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<SendProposalPage> model = new CompoundPropertyModel<SendProposalPage>(
@@ -72,11 +72,11 @@
 			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 @@
 							.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 @@
 					if (!StringUtils.isEmpty(e.getMessage())) {
 						error(e.getMessage());
 					} else {
-						error("Failed to send proposal!");
+						error(getString("gb.failedToSendProposal"));
 					}
 				}
 			}
@@ -133,8 +130,8 @@
 		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 7e8995e..2996b66 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -89,7 +89,7 @@
 			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<Void>("metrics", MetricsPage.class,
diff --git a/src/com/gitblit/wicket/pages/TagPage.java b/src/com/gitblit/wicket/pages/TagPage.java
index acdd77f..b7a5374 100644
--- a/src/com/gitblit/wicket/pages/TagPage.java
+++ b/src/com/gitblit/wicket/pages/TagPage.java
@@ -51,7 +51,7 @@
 
 		// 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.

--
Gitblit v1.9.1