summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/GitBlitWebApp.java
diff options
context:
space:
mode:
authorLukasz Jader <ljaderdev@gmail.com>2013-04-07 16:51:38 +0200
committerDavid Ostrovsky <david@ostrovsky.org>2013-04-14 11:34:50 +0200
commit2b480a64f35463739ace44ef09db1a9957944743 (patch)
tree6ab6e68212da57e0f2adac4f1a67ec4edd0bee6a /src/main/java/com/gitblit/wicket/GitBlitWebApp.java
parent29c07cabf0309fc9254f94db18cff9f9dcc2b3df (diff)
downloadgitblit-2b480a64f35463739ace44ef09db1a9957944743.tar.gz
gitblit-2b480a64f35463739ace44ef09db1a9957944743.zip
Overwrite created session locale with forced one
Diffstat (limited to 'src/main/java/com/gitblit/wicket/GitBlitWebApp.java')
-rw-r--r--src/main/java/com/gitblit/wicket/GitBlitWebApp.java11
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