From c0831038bd7bde32df5af8fb851d210daeccc853 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Mon, 12 Dec 2016 22:41:10 +0700 Subject: i18n for pages --- .../com/juick/www/controllers/IndexController.java | 12 +- .../com/juick/www/controllers/PMController.java | 1 - .../juick/www/controllers/SettingsController.java | 1 - .../www/controllers/ShowMessageController.java | 8 +- .../src/main/resources/messages.properties | 9 ++ .../src/main/resources/messages_en.properties | 9 ++ .../src/main/webapp/WEB-INF/templates/index.html | 21 --- .../webapp/WEB-INF/templates/layout/error.html | 25 ---- .../webapp/WEB-INF/templates/layout/login.html | 145 --------------------- .../WEB-INF/templates/layout/mainLayout.html | 19 ++- .../WEB-INF/templates/layout/partial/footer.html | 44 +++---- .../templates/layout/partial/navigation.html | 51 ++++---- .../main/webapp/WEB-INF/templates/views/error.html | 27 ++++ .../main/webapp/WEB-INF/templates/views/index.html | 7 +- .../main/webapp/WEB-INF/templates/views/login.html | 145 +++++++++++++++++++++ .../templates/views/partial/blog_postform.html | 24 ++-- .../templates/views/partial/homecolumn.html | 9 +- .../templates/views/partial/settings_tabs.html | 12 +- .../src/main/webapp/static/tagscloud.png | Bin 0 -> 42316 bytes juick-spring-www/src/main/webapp/tagscloud.png | Bin 42316 -> 0 bytes 20 files changed, 281 insertions(+), 288 deletions(-) delete mode 100644 juick-spring-www/src/main/webapp/WEB-INF/templates/index.html delete mode 100644 juick-spring-www/src/main/webapp/WEB-INF/templates/layout/error.html delete mode 100644 juick-spring-www/src/main/webapp/WEB-INF/templates/layout/login.html create mode 100644 juick-spring-www/src/main/webapp/WEB-INF/templates/views/error.html create mode 100644 juick-spring-www/src/main/webapp/WEB-INF/templates/views/login.html create mode 100644 juick-spring-www/src/main/webapp/static/tagscloud.png delete mode 100644 juick-spring-www/src/main/webapp/tagscloud.png diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java index 7821a916..4576e9d3 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java @@ -55,12 +55,7 @@ public class IndexController { User visitor = UserUtils.getCurrentUser(); - String title; - if (!visitor.isAnonym()) { - title = "Популярные"; - } else { - title = "Микроблоги Juick: популярные записи"; - } + String title = ""; int before = paramBefore.orElse(0); @@ -95,7 +90,6 @@ public class IndexController { } model.addAttribute("title", title); model.addAttribute("tags", tagService.getPopularTags()); - model.addAttribute("showAdv", true); List msgs = messagesService.getMessages(mids); List blUIDs = userService.checkBL(visitor.getUid(), msgs.stream().map(m -> m.getUser().getUid()).collect(Collectors.toList())); @@ -121,12 +115,12 @@ public class IndexController { @RequestMapping(value = "/login", method = RequestMethod.GET) public String getLoginForm() { - return "layout/login"; + return "views/login"; } @RequestMapping(value = "/login-error", method = RequestMethod.GET) public String getLoginErrorForm(Model model) { model.addAttribute("loginError", true); - return "layout/login"; + return "views/login"; } } \ No newline at end of file diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java index fc5937dd..3228b4c0 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java @@ -67,7 +67,6 @@ public class PMController { uname = ""; } context.put("title", title); - context.put("visitor", visitor); context.put("msgs", msgs); context.put("tags", tagService.getPopularTags()); context.put("uname", uname); diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java index e7319fb9..65309e4e 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java @@ -269,7 +269,6 @@ public class SettingsController { throw new HttpBadRequestException(); } context.put("title", "Настройки"); - context.put("visitor", visitor); context.put("result", result); return "views/settings_result"; } diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java index df204c5f..62e7293b 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java @@ -92,7 +92,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/friends") @@ -111,7 +111,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/readers") @@ -130,7 +130,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/tags") @@ -149,7 +149,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/{postNumber}") diff --git a/juick-spring-www/src/main/resources/messages.properties b/juick-spring-www/src/main/resources/messages.properties index 42494512..1f594445 100644 --- a/juick-spring-www/src/main/resources/messages.properties +++ b/juick-spring-www/src/main/resources/messages.properties @@ -16,6 +16,10 @@ link.recommended=Рекомендации link.postMessage=Написать сообщение link.logout=Выйти +link.settings.main=Главная +link.settings.password=Пароль +link.settings.about=О пользователе + label.sponsor=Спонсор label.sponsors=Спонсоры label.search=Поиск @@ -23,6 +27,11 @@ label.register=Зарегистрироваться label.username=Имя пользователя label.password=Пароль +postForm.newMessage=Новое сообщение +postForm.imageLink=Ссылка на изображение (JPG/PNG, до 10Мб) +postForm.orImageUpload=или загрузить
+postForm.tags=Теги (через пробел) + button.send=Отправить message.loginForSending=Чтобы добавлять сообщения и комментарии, представьтесь diff --git a/juick-spring-www/src/main/resources/messages_en.properties b/juick-spring-www/src/main/resources/messages_en.properties index fd1e17e0..a40ac2b2 100644 --- a/juick-spring-www/src/main/resources/messages_en.properties +++ b/juick-spring-www/src/main/resources/messages_en.properties @@ -16,6 +16,10 @@ link.recommended=Recommended link.postMessage=Post link.logout=Logout +link.settings.main=Main +link.settings.password=Password +link.settings.about=About + label.sponsor=Sponsor label.sponsors=Sponsors label.search=Search @@ -23,6 +27,11 @@ label.register=Register label.username=User name label.password=Password +postForm.newMessage=New message +postForm.imageLink=Link to image (JPG/PNG, up to 10 MB) +postForm.orImageUpload=or Upload
+postForm.tags=Tags (space separated) + button.send=Send message.loginForSending=Login for post messages and comments diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html deleted file mode 100644 index 7ee2156d..00000000 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - Популярные - Микроблоги Juick: популярные записи - - - -
-

Главная страница !

-

-

-

-
- - - \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/error.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/error.html deleted file mode 100644 index 60df54a7..00000000 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/error.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - Error page - - - -

404

-

Error java.lang.NullPointerException

- Back to Home Page - - \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/login.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/login.html deleted file mode 100644 index bcfa318d..00000000 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/login.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - Juick - - - - - - - - -
juick.com © 2008-2017   Контакты · Помощь
- -
- Зарегистрироваться: - - -
XMPP -
[(#{message.sendLoginToXmpp})]
-
-
-
-

Произошла ошибка, проверьте имя пользователя и пароль

- Уже зарегистрированы? -
-
- - - -
-
-
- - \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/mainLayout.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/mainLayout.html index ef9887d2..c07886b6 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/mainLayout.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/mainLayout.html @@ -11,20 +11,19 @@ Juick.com - + -
Navigation block
-
-

Main content

-
- - -
Footer
+
Navigation block
+
+

Main content

+
+ +
Footer
\ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/footer.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/footer.html index 154e1ccf..1d565db3 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/footer.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/footer.html @@ -1,13 +1,9 @@ - - - - +
- - - \ No newline at end of file +
\ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/navigation.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/navigation.html index c7cd1c81..2317369c 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/navigation.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/layout/partial/navigation.html @@ -1,43 +1,50 @@ - - - - -
+
@@ -45,6 +52,4 @@

[(#{message.loginForSending(@{/login})})]

-
- - +
\ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/error.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/error.html new file mode 100644 index 00000000..98ce70e4 --- /dev/null +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/error.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + Error page + + + +

404

+ +

Error java.lang.NullPointerException

+ + Back to Home Page + + \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html index 8f667135..6b6f278d 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html @@ -3,17 +3,20 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/mainLayout}"> - Main title + Популярные + Микроблоги Juick: популярные записи
-
+
+ + \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/login.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/login.html new file mode 100644 index 00000000..2736ca53 --- /dev/null +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/login.html @@ -0,0 +1,145 @@ + + + + + + + + Juick + + + + + + + + +
juick.com © 2008-2017   Контакты · Помощь
+ +
+ Зарегистрироваться: + + +
XMPP +
[(#{message.sendLoginToXmpp})]
+
+
+
+

Произошла ошибка, проверьте имя пользователя и пароль

+ Уже зарегистрированы? +
+
+ + + +
+
+
+ + \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html index 804605dd..df2caf7b 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html @@ -1,12 +1,14 @@ -
-
- -
- или загрузить
+
+ +
+ +
+ + [(#{postForm.orImageUpload})] -
- -
-
- \ No newline at end of file +
+ +
+
+ + \ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/homecolumn.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/homecolumn.html index 2f0d707c..cbf25c3b 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/homecolumn.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/homecolumn.html @@ -1,11 +1,4 @@ - - - - -

+

Tags
конструктор сайтов

- - diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/settings_tabs.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/settings_tabs.html index d7901d5e..253511b5 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/settings_tabs.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/settings_tabs.html @@ -1,5 +1,7 @@ - \ No newline at end of file +
+ +
\ No newline at end of file diff --git a/juick-spring-www/src/main/webapp/static/tagscloud.png b/juick-spring-www/src/main/webapp/static/tagscloud.png new file mode 100644 index 00000000..3e1bf169 Binary files /dev/null and b/juick-spring-www/src/main/webapp/static/tagscloud.png differ diff --git a/juick-spring-www/src/main/webapp/tagscloud.png b/juick-spring-www/src/main/webapp/tagscloud.png deleted file mode 100644 index 3e1bf169..00000000 Binary files a/juick-spring-www/src/main/webapp/tagscloud.png and /dev/null differ -- cgit v1.2.3