From 8fa9a684c8a06bed7235f58f79af2d88da13fede Mon Sep 17 00:00:00 2001 From: KillyMXI Date: Sun, 20 Aug 2017 18:15:09 +0300 Subject: www: i18n --- .../main/java/com/juick/www/controllers/Home.java | 4 +-- .../main/java/com/juick/www/controllers/Tags.java | 3 +- .../main/java/com/juick/www/controllers/User.java | 5 +-- juick-www/src/main/resources/messages.properties | 35 ++++++++++++------ .../src/main/resources/messages_ru.properties | 41 +++++++++++++++------- juick-www/src/main/static/scripts.js | 2 +- juick-www/src/main/webapp/WEB-INF/views/blog.html | 6 ++-- juick-www/src/main/webapp/WEB-INF/views/index.html | 4 ++- .../src/main/webapp/WEB-INF/views/macros/tree.html | 6 ++-- .../webapp/WEB-INF/views/partial/newmessage.html | 8 ++--- .../webapp/WEB-INF/views/partial/thread_list.html | 7 ++-- juick-www/src/main/webapp/WEB-INF/views/post.html | 13 ++++--- .../src/main/webapp/WEB-INF/views/thread.html | 18 +++++----- 13 files changed, 92 insertions(+), 60 deletions(-) (limited to 'juick-www/src') diff --git a/juick-www/src/main/java/com/juick/www/controllers/Home.java b/juick-www/src/main/java/com/juick/www/controllers/Home.java index 7a019af8..bda3d60f 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Home.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Home.java @@ -184,9 +184,7 @@ public class Home { if (paramSearch != null) { nextpage += "&search=" + URLEncoder.encode(paramSearch, CharEncoding.UTF_8); } - - String next = "

Читать дальше →

"; - model.addAttribute("next", next); + model.addAttribute("nextpage", nextpage); } UriComponents builder = ServletUriComponentsBuilder.fromCurrentRequestUri().build(); String queryString = builder.getQuery(); diff --git a/juick-www/src/main/java/com/juick/www/controllers/Tags.java b/juick-www/src/main/java/com/juick/www/controllers/Tags.java index eef317a9..4c00ad6a 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Tags.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Tags.java @@ -105,8 +105,7 @@ public class Tags { model.addAttribute("isModerator", visitor.getUid() == 3694); if (mids.size() >= 20) { String nextpage = "/tag/" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8) + "?before=" + mids.get(mids.size() - 1); - String next = "

Читать дальше →

"; - model.addAttribute("next", next); + model.addAttribute("nextpage", nextpage); } return "views/index"; } diff --git a/juick-www/src/main/java/com/juick/www/controllers/User.java b/juick-www/src/main/java/com/juick/www/controllers/User.java index 0daad082..26eb7cb1 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/User.java +++ b/juick-www/src/main/java/com/juick/www/controllers/User.java @@ -171,13 +171,10 @@ public class User { if (paramSearch != null) { nextpage += "&search=" + URLEncoder.encode(paramSearch, CharEncoding.UTF_8); } - if (paramTag != null) { nextpage += "&tag=" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8); } - - String next = "

Читать дальше →

"; - model.addAttribute("next", next); + model.addAttribute("nextpage", nextpage); } UriComponents builder = ServletUriComponentsBuilder.fromCurrentRequestUri().build(); String queryString = builder.getQuery(); diff --git a/juick-www/src/main/resources/messages.properties b/juick-www/src/main/resources/messages.properties index bddc56eb..e40810fc 100644 --- a/juick-www/src/main/resources/messages.properties +++ b/juick-www/src/main/resources/messages.properties @@ -27,26 +27,40 @@ 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.newMessage=New message... +postForm.imageLink=Link to image +postForm.imageFormats=JPG/PNG, up to 10 MB +postForm.or=or +postForm.upload=Upload postForm.tags=Tags (space separated) +postForm.submit=Send -button.send=Send - -message.loginForSending=Login to post messages and comments message.recommend=Recommend +message.recommendedBy=Recommended by +message.comment=Comment +message.writeComment=Write a comment... +message.subscribe=Subscribe +message.subscribed=Subscribed +message.delete=Delete +message.loginForSending=Login to post messages and comments message.sendLoginToXmpp=Send LOGIN to juick@juick.com +messages.next=Next + +reply.reply=Reply +reply.inReplyTo=in reply to + +replies.showAsList=Show as list +replies.showAsTree=Show as tree +replies.unfoldAll=Unfold all + question.areRegistered=Already registered? title.help=Help title.loginOrSignup=Juick - Log In or Sign Up title.index.anonym=Juick microblogs: popular posts title.index.user=Popular -message.comment=Comment -postForm.writeReply=Write a reply -messages.next=Next + error.pageNotFound=Page not found error.pageNotFound.description=User probably deleted this post, or this page never existed. @@ -57,4 +71,5 @@ blog.iread=I read blog.readers=My readers blog.bl=My blacklist blog.messages=Messages -blog.comments=Comments \ No newline at end of file +blog.comments=Comments +blog.allPostsWithTag=All posts tagged \ No newline at end of file diff --git a/juick-www/src/main/resources/messages_ru.properties b/juick-www/src/main/resources/messages_ru.properties index 2e22659d..5ce1d47e 100644 --- a/juick-www/src/main/resources/messages_ru.properties +++ b/juick-www/src/main/resources/messages_ru.properties @@ -1,7 +1,7 @@ date.format=dd.MM.yyyy -link.settings = Настройки -link.returnToMain =Вернуться на главную +link.settings=Настройки +link.returnToMain=Вернуться на главную link.contacts=Контакты link.help=Помощь link.adv=Реклама @@ -27,26 +27,40 @@ label.register=Зарегистрироваться label.username=Имя пользователя label.password=Пароль -postForm.newMessage=Новое сообщение -postForm.imageLink=Ссылка на изображение (JPG/PNG, до 10Мб) -postForm.orImageUpload=или загрузить
-postForm.tags=Теги (через пробел) +postForm.newMessage=Новое сообщение... +postForm.imageLink=Ссылка на изображение +postForm.imageFormats=JPG/PNG, до 10Мб +postForm.or=или +postForm.upload=загрузить +postForm.tags=Теги (через пробел) +postForm.submit=Отправить -button.send=Отправить - -message.loginForSending=Чтобы добавлять сообщения и комментарии, представьтесь message.recommend=Рекомендовать +message.recommendedBy=Рекомендовали +message.comment=Комментировать +message.writeComment=Написать комментарий... +message.subscribe=Подписаться +message.subscribed=Подписан +message.delete=Удалить +message.loginForSending=Чтобы добавлять сообщения и комментарии, представьтесь message.sendLoginToXmpp=Отправьте LOGIN на juick@juick.com +messages.next=Читать дальше + +reply.reply=Ответить +reply.inReplyTo=в ответ на + +replies.showAsList=Показать списком +replies.showAsTree=Показать деревом +replies.unfoldAll=Раскрыть все + question.areRegistered=Уже зарегистрированы? title.help=Справка title.loginOrSignup=Juick - Войдите в систему или зарегистрируйтесь title.index.anonym=Микроблоги Juick: популярные записи title.index.user=Популярные -message.comment=Комментировать -postForm.writeReply=Написать ответ -messages.next=Читать далее + error.pageNotFound=Страница не найдена error.pageNotFound.description=Сожалеем, но страницу с этим адресом удалил её автор, либо её никогда не существовало. @@ -57,4 +71,5 @@ blog.iread=Я читаю blog.readers=Мои подписчики blog.bl=Черный список blog.messages=Сообщения -blog.comments=Комментарии \ No newline at end of file +blog.comments=Комментарии +blog.allPostsWithTag=Все записи с тегом \ No newline at end of file diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index 39d57118..0254c5f1 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -53,7 +53,7 @@ const translations = { 'message.reply': 'Reply', 'message.likeThisMessage?': 'Recommend this message?', 'postForm.pleaseInputMessageText': 'Please input message text', - //'postForm.upload': 'upload', + 'postForm.upload': 'Upload', 'comment.writeComment': 'Write a comment...', 'shareDialog.linkToMessage': 'Link to message', 'shareDialog.messageNumber': 'Message number', diff --git a/juick-www/src/main/webapp/WEB-INF/views/blog.html b/juick-www/src/main/webapp/WEB-INF/views/blog.html index 8d241c82..87007ea8 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/blog.html +++ b/juick-www/src/main/webapp/WEB-INF/views/blog.html @@ -5,13 +5,13 @@ {% endif %} {% if paramTag | default('') is not empty %} -

← Все записи с тегом {{ paramTag.name | escape }}

+

← {{ i18n("messages","blog.allPostsWithTag") }} {{ paramTag.name | escape }}

{% endif %} {% for msg in msgs %} {% include "views/partial/message" %} {% endfor %} -{% if (next | default('')) is not empty %} -{{ next | raw }} +{% if nextpage | default('') is not empty %} +

{% endif %} {% endblock %} {% block "column" %} diff --git a/juick-www/src/main/webapp/WEB-INF/views/index.html b/juick-www/src/main/webapp/WEB-INF/views/index.html index 6bf81cac..506979b5 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/index.html +++ b/juick-www/src/main/webapp/WEB-INF/views/index.html @@ -10,7 +10,9 @@ {% for msg in msgs %} {% include "views/partial/message" %} {% endfor %} -{{ next | default ('') | raw }} +{% if nextpage | default('') is not empty %} +

+{% endif %} {% endblock %} {% block "column" %} {% include "views/partial/homecolumn" %} diff --git a/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html b/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html index b20e99fd..a5966e2b 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html +++ b/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html @@ -37,13 +37,13 @@ {% endif %} + · {{ i18n("messages","reply.reply") }} {% elseif visitor.uid == 0 %} - · Ответить + · {{ i18n("messages","reply.reply") }} {% endif %} {% if level == 0 and msg.childsCount > 1 and replies.size() > 10 %} diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html b/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html index 1e43b92f..1333351b 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html @@ -1,10 +1,10 @@
- +
- или загрузить
-
- + {{ i18n("messages","postForm.or") }} {{ i18n("messages","postForm.upload") }}
+
+
\ No newline at end of file diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/thread_list.html b/juick-www/src/main/webapp/WEB-INF/views/partial/thread_list.html index af04e4fa..3ef9dd16 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/partial/thread_list.html +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/thread_list.html @@ -35,12 +35,15 @@ {% endif %} + {% elseif visitor.uid == 0 %} + · {{ i18n("messages","reply.reply") }} + {% else %} {% endif %} diff --git a/juick-www/src/main/webapp/WEB-INF/views/post.html b/juick-www/src/main/webapp/WEB-INF/views/post.html index 51b044da..56e48a55 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/post.html +++ b/juick-www/src/main/webapp/WEB-INF/views/post.html @@ -2,11 +2,14 @@ {% import "views/macros/tags" %} {% block content %}
-

Фото: - (JPG, PNG, до 10Мб)

- -


-

+

+ Фото: + ({{ i18n("messages","postForm.imageFormats") }}) +

+

+
+ +

Теги:

{{ tags(visitor.name, tags) }} diff --git a/juick-www/src/main/webapp/WEB-INF/views/thread.html b/juick-www/src/main/webapp/WEB-INF/views/thread.html index c0e37851..906ddf1f 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/thread.html +++ b/juick-www/src/main/webapp/WEB-INF/views/thread.html @@ -34,13 +34,13 @@
- +
{% endif %} {% if recomm is not empty %} -
Рекомендовали ({{ recomm.size() }}): +
{{ i18n("messages","message.recommendedBy") }} ({{ recomm.size() }}): {% for rec in recomm %} @{{ rec }}{% if loop.index < (loop.length - 1) %}, {% endif %} {% endfor %} @@ -60,21 +60,21 @@ {% if visitorSubscribed %}
  • - Подписан
  • + {{ i18n("messages","message.subscribed") }} {% else %}
  • - Подписаться
  • + {{ i18n("messages","message.subscribe") }} {% endif %} {% if not visitorInBL %}
  • - Рекомендовать
  • + {{ i18n("messages","message.recommend") }} {% endif %} {% else %}
  • - Удалить
  • + {{ i18n("messages","message.delete") }} {% endif %} {% endif %} @@ -83,12 +83,12 @@

    Ответы ({{ replies.size() }})

    -- cgit v1.2.3