From ab78d170650106d1d1113282598b6d8270ef2e76 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Fri, 31 Jan 2014 21:44:51 +0700 Subject: Russian as default --- src/java/com/juick/http/www/Discover.java | 14 ++-- src/java/com/juick/http/www/Help.java | 16 ++--- src/java/com/juick/http/www/Home.java | 29 ++++----- src/java/com/juick/http/www/Login.java | 27 ++------ src/java/com/juick/http/www/NewMessage.java | 19 ++---- src/java/com/juick/http/www/PM.java | 32 ++++----- src/java/com/juick/http/www/PageTemplates.java | 90 +++++++++++++++++--------- src/java/com/juick/http/www/Settings.java | 14 ++-- src/java/com/juick/http/www/SignUp.java | 36 ++++------- src/java/com/juick/http/www/User.java | 88 +++++++++++-------------- src/java/com/juick/http/www/UserThread.java | 70 +++++++++----------- 11 files changed, 190 insertions(+), 245 deletions(-) (limited to 'src/java/com') diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java index 4fb4c9c0..4e4a6b3d 100644 --- a/src/java/com/juick/http/www/Discover.java +++ b/src/java/com/juick/http/www/Discover.java @@ -25,8 +25,6 @@ import java.net.URLDecoder; import java.net.URLEncoder; import java.sql.Connection; import java.util.ArrayList; -import java.util.Locale; -import java.util.ResourceBundle; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -39,8 +37,6 @@ public class Discover { protected void doGet(Connection sql, Connection sqlSearch, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { com.juick.User visitor = Utils.getVisitorUser(sql, request, response); - Locale locale = request.getLocale(); - ResourceBundle rb = ResourceBundle.getBundle("Blogs", locale); String requesturi = request.getRequestURI(); @@ -77,15 +73,15 @@ public class Discover { canonical = ""; } PageTemplates.pageHead(out, title, canonical); - PageTemplates.pageNavigation(out, locale, visitor, null); + PageTemplates.pageNavigation(out, visitor, null); - PageTemplates.pageHomeColumn(out, sql, visitor, locale); + PageTemplates.pageHomeColumn(out, sql, visitor); out.println("
"); if (mids.size() > 0) { out.println(""); } @@ -96,8 +92,8 @@ public class Discover { out.println("
"); - PageTemplates.pageFooter(request, out, locale, visitor, true); - PageTemplates.pageDialogTemplate(out, locale); + PageTemplates.pageFooter(request, out, visitor, true); + PageTemplates.pageDialogTemplate(out); PageTemplates.pageEnd(out); } finally { out.close(); diff --git a/src/java/com/juick/http/www/Help.java b/src/java/com/juick/http/www/Help.java index c6a64622..101988bb 100644 --- a/src/java/com/juick/http/www/Help.java +++ b/src/java/com/juick/http/www/Help.java @@ -23,8 +23,6 @@ import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; -import java.util.Locale; -import java.util.ResourceBundle; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -36,17 +34,11 @@ import javax.servlet.http.HttpServletResponse; public class Help { protected void doRedirectToHelpIndex(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String lang = request.getLocale().getLanguage(); - if (!(lang.equals("ru") || lang.equals("fr"))) { - lang = "en"; - } - Utils.sendTemporaryRedirect(response, "/help/" + lang + "/"); + Utils.sendTemporaryRedirect(response, "/help/ru/"); } protected void doGetHelp(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { com.juick.User visitor = Utils.getVisitorUser(sql, request, response); - Locale locale = request.getLocale(); - ResourceBundle rb = ResourceBundle.getBundle("Global", locale); String path[] = request.getRequestURI().split("/"); String page; @@ -74,8 +66,8 @@ public class Help { response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); try { - PageTemplates.pageHead(out, rb.getString("Help"), ""); - PageTemplates.pageNavigation(out, locale, visitor, null); + PageTemplates.pageHead(out, "Помощь", ""); + PageTemplates.pageNavigation(out, visitor, null); out.println("