diff options
author | Lukasz Jader <ljaderdev@gmail.com> | 2013-04-07 16:51:38 +0200 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2013-04-14 11:34:50 +0200 |
commit | 2b480a64f35463739ace44ef09db1a9957944743 (patch) | |
tree | 6ab6e68212da57e0f2adac4f1a67ec4edd0bee6a /src/main/java/com/gitblit/wicket/GitBlitWebApp.java | |
parent | 29c07cabf0309fc9254f94db18cff9f9dcc2b3df (diff) | |
download | gitblit-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.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
|