diff options
author | KillyMXI | 2017-08-20 18:15:09 +0300 |
---|---|---|
committer | KillyMXI | 2017-08-20 18:15:09 +0300 |
commit | 8fa9a684c8a06bed7235f58f79af2d88da13fede (patch) | |
tree | 9fc35b94e23c90540e79272235b9900c6b9e3236 /juick-www/src/main | |
parent | 0bcb1e9529e6456db67a91eb2c699e26b5bbe42e (diff) |
www: i18n
Diffstat (limited to 'juick-www/src/main')
13 files changed, 92 insertions, 60 deletions
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 = "<p class=\"page\"><a href=\"" + nextpage + "\" rel=\"prev\">Читать дальше →</a></p>"; - 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 = "<p class=\"page\"><a href=\"" + nextpage + "\" rel=\"prev\">Читать дальше →</a></p>"; - 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 = "<p class=\"page\"><a href=\"" + nextpage + "\" rel=\"prev\">Читать дальше →</a></p>"; - 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 <a href="#">Upload</a><br/> +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=<a href="{0}" class="a-login">Login</a> 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=<a href="{0}" class="a-login">Login</a> to post messages and comments message.sendLoginToXmpp=Send <b>LOGIN</b> to <a href="xmpp:juick@juick.com?message;body=LOGIN">juick@juick.com</a> +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=или <a href="#">загрузить</a><br/> -postForm.tags=Теги (через пробел) +postForm.newMessage=Новое сообщение... +postForm.imageLink=Ссылка на изображение +postForm.imageFormats=JPG/PNG, до 10Мб +postForm.or=или +postForm.upload=загрузить +postForm.tags=Теги (через пробел) +postForm.submit=Отправить -button.send=Отправить - -message.loginForSending=Чтобы добавлять сообщения и комментарии, <a href="{0}" class="a-login">представьтесь</a> message.recommend=Рекомендовать +message.recommendedBy=Рекомендовали +message.comment=Комментировать +message.writeComment=Написать комментарий... +message.subscribe=Подписаться +message.subscribed=Подписан +message.delete=Удалить +message.loginForSending=Чтобы добавлять сообщения и комментарии, <a href="{0}" class="a-login">представьтесь</a> message.sendLoginToXmpp=Отправьте <b>LOGIN</b> на <a href="xmpp:juick@juick.com?message;body=LOGIN">juick@juick.com</a> +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 @@ <!--noindex--> {% endif %} {% if paramTag | default('') is not empty %} -<p class="page"><a href="/tag/{{ paramTag.name | urlencode }}">← Все записи с тегом <b>{{ paramTag.name | escape }}</b></a></p> +<p class="page"><a href="/tag/{{ paramTag.name | urlencode }}">← {{ i18n("messages","blog.allPostsWithTag") }} <b>{{ paramTag.name | escape }}</b></a></p> {% endif %} {% for msg in msgs %} {% include "views/partial/message" %} {% endfor %} -{% if (next | default('')) is not empty %} -{{ next | raw }} +{% if nextpage | default('') is not empty %} +<p class="page"><a href="{{ nextpage | raw }}" rel="prev">{{ i18n("messages","messages.next") }} →</a></p> {% 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 %} +<p class="page"><a href="{{ nextpage | raw }}" rel="prev">{{ i18n("messages","messages.next") }} →</a></p> +{% 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 %} <div class="msg-links">/{{ msg.rid }} {% if msg.replyto > 0 %} - в ответ на <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a> + {{ i18n("messages","reply.inReplyTo") }} <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a> {% endif %} {% if msg.VisitorCanComment %} - · <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">Ответить</a></div> + · <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">{{ i18n("messages","reply.reply") }}</a></div> <div class="msg-comment" style="display: none"></div> {% elseif visitor.uid == 0 %} - · <a href="#" class="a-login">Ответить</a></div> + · <a href="#" class="a-login">{{ i18n("messages","reply.reply") }}</a></div> {% 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 @@ <form action="/post" method="post" enctype="multipart/form-data"> <section id="newmessage"> - <textarea name="body" placeholder="Новое сообщение..."></textarea> + <textarea name="body" placeholder="{{ i18n("messages","postForm.newMessage") }}"></textarea> <div> - <input type="text" class="img" name="img" placeholder="Ссылка на изображение (JPG/PNG, до 10Мб)"/> или <a href="#">загрузить</a><br/> - <input type="text" class="tags" name="tags" placeholder="Теги (через пробел)"/><br/> - <input type="submit" class="subm" value="Отправить"/> + <input type="text" class="img" name="img" placeholder="{{ i18n("messages","postForm.imageLink") }} ({{ i18n("messages","postForm.imageFormats") }})"/> {{ i18n("messages","postForm.or") }} <a href="#">{{ i18n("messages","postForm.upload") }}</a><br/> + <input type="text" class="tags" name="tags" placeholder="{{ i18n("messages","postForm.tags") }}"/><br/> + <input type="submit" class="subm" value="{{ i18n("messages","postForm.submit") }}"/> </div> </section> </form>
\ 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 %} <div class="msg-links">/{{ msg.rid }} {% if msg.replyto > 0 %} - в ответ на <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a> + {{ i18n("messages","reply.inReplyTo") }} <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a> {% endif %} {% if msg.VisitorCanComment %} - · <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">Ответить</a> + · <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">{{ i18n("messages","reply.reply") }}</a> </div> <div class="msg-comment" style="display: none;"></div> + {% elseif visitor.uid == 0 %} + · <a href="#" class="a-login">{{ i18n("messages","reply.reply") }}</a> + </div> {% else %} </div> {% 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 %} <form action="/post2" method="post" id="postmsg" enctype="multipart/form-data"> - <p style="text-align: left"><b>Фото:</b> <span id="attachmentfile"> - <input type="file" name="attach"/> <i>(JPG, PNG, до 10Мб)</i></span></p> - - <p><textarea name="body" class="newmessage" rows="7" cols="10">{{ body }}</textarea><br/> - <input type="submit" class="subm" value=" Отправить "/></p> + <p style="text-align: left"> + <b>Фото:</b> <span id="attachmentfile"> + <input type="file" name="attach"/> <i>({{ i18n("messages","postForm.imageFormats") }})</i></span> + </p> + <p> + <textarea name="body" class="newmessage" rows="7" cols="10">{{ body }}</textarea><br/> + <input type="submit" class="subm" value=" {{ i18n("messages","postForm.submit") }} "/> + </p> </form> <p style="text-align: left"><b>Теги:</b></p> {{ 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 @@ <input type="hidden" name="mid" value="{{ msg.mid }}"/> <div class="msg-comment"> <div class="ta-wrapper"> - <textarea name="body" rows="1" class="reply" placeholder="Написать комментарий"></textarea> + <textarea name="body" rows="1" class="reply" placeholder="{{ i18n("messages","message.writeComment") }}"></textarea> </div> </div> </form> {% endif %} {% if recomm is not empty %} - <div class="msg-recomms">Рекомендовали ({{ recomm.size() }}): + <div class="msg-recomms">{{ i18n("messages","message.recommendedBy") }} ({{ recomm.size() }}): {% for rec in recomm %} <a href="/{{ rec }}/">@{{ rec }}</a>{% if loop.index < (loop.length - 1) %}, {% endif %} {% endfor %} @@ -60,21 +60,21 @@ {% if visitorSubscribed %} <li><a href="/post?body=U+%23{{ msg.mid }}"> <div style="background-position: -48px 0"></div> - Подписан</a></li> + {{ i18n("messages","message.subscribed") }}</a></li> {% else %} <li><a href="/post?body=S+%23{{ msg.mid }}"> <div style="background-position: -16px 0"></div> - Подписаться</a></li> + {{ i18n("messages","message.subscribe") }}</a></li> {% endif %} {% if not visitorInBL %} <li><a href="/post?body=%21+%23{{ msg.mid }}"> <div style="background-position: -32px 0"></div> - Рекомендовать</a></li> + {{ i18n("messages","message.recommend") }}</a></li> {% endif %} {% else %} <li><a href="/post?body=D+%23{{ msg.mid }}"> <div style="background-position: 0"></div> - Удалить</a></li> + {{ i18n("messages","message.delete") }}</a></li> {% endif %} {% endif %} </ul> @@ -83,12 +83,12 @@ <div class="title2"> <div class="title2-right"> {% if listview %} - <a href="?view=tree" rel="nofollow">Показать деревом</a> + <a href="?view=tree" rel="nofollow">{{ i18n("messages","replies.showAsTree") }}</a> {% else %} {% if foldable %} - <span id="unfoldall"><a href="#">Раскрыть все</a> · </span> + <span id="unfoldall"><a href="#">{{ i18n("messages","replies.unfoldAll") }}</a> · </span> {% endif %} - <a href="?view=list" rel="nofollow">Показать списком</a> + <a href="?view=list" rel="nofollow">{{ i18n("messages","replies.showAsList") }}</a> {% endif %} </div> <h2>Ответы ({{ replies.size() }})</h2> |