diff options
author | James Moger <james.moger@gitblit.com> | 2013-04-08 09:42:15 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-04-08 09:42:15 -0400 |
commit | 0dc679ee461a45503d6ce0a99afbc059fd18b294 (patch) | |
tree | 66c7bf052c24cc8f65d31f10f6ccb766d4034a0d /src/main/java | |
parent | 2cf37b6a3fb6469e0c263eceb55b000ac8c944d1 (diff) | |
parent | a770f32c4cc4f96777ae7a3ee853238f9b5ec914 (diff) | |
download | gitblit-0dc679ee461a45503d6ce0a99afbc059fd18b294.tar.gz gitblit-0dc679ee461a45503d6ce0a99afbc059fd18b294.zip |
Merge branch 'force-locale' of https://github.com/ljader/gitblit
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitBlitWebApp.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.java b/src/main/java/com/gitblit/wicket/GitBlitWebApp.java index 2300d0ff..74b80551 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.java +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.java @@ -15,6 +15,8 @@ */
package com.gitblit.wicket;
+import java.util.Locale;
+
import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.Request;
@@ -25,6 +27,7 @@ import org.apache.wicket.protocol.http.WebApplication; import com.gitblit.GitBlit;
import com.gitblit.Keys;
+import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.pages.ActivityPage;
import com.gitblit.wicket.pages.BlamePage;
import com.gitblit.wicket.pages.BlobDiffPage;
@@ -143,7 +146,13 @@ public class GitBlitWebApp extends WebApplication { @Override
public final Session newSession(Request request, Response response) {
- return new GitBlitWebSession(request);
+ GitBlitWebSession gitBlitWebSession = new GitBlitWebSession(request);
+
+ String forcedLocale = GitBlit.getString(Keys.web.forceDefaultLocale, null);
+ if (!StringUtils.isEmpty(forcedLocale)) {
+ gitBlitWebSession.setLocale(new Locale(forcedLocale));
+ }
+ return gitBlitWebSession;
}
@Override
|