##// END OF EJS Templates
Pluralize thread info inside a thread
neko259 -
r1332:255bbeb2 default
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -7,7 +7,7 b' msgid ""'
7 msgstr ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "Report-Msgid-Bugs-To: \n"
9 "Report-Msgid-Bugs-To: \n"
10 "POT-Creation-Date: 2015-09-04 16:30+0300\n"
10 "POT-Creation-Date: 2015-09-04 19:00+0300\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -319,9 +319,7 b' msgstr "\xd0\x9e\xd1\x82\xd0\xb2\xd0\xb5\xd1\x82\xd1\x8b"'
319
319
320 #: templates/boards/post.html:105
320 #: templates/boards/post.html:105
321 #, python-format
321 #, python-format
322 #| msgid "%(count)s message,"
322 msgid "%(count)s message"
323 #| msgid_plural "%(count)s messages,"
324 msgid "%(count)s message,"
325 msgid_plural "%(count)s messages"
323 msgid_plural "%(count)s messages"
326 msgstr[0] "%(count)s сообщение"
324 msgstr[0] "%(count)s сообщение"
327 msgstr[1] "%(count)s сообщения"
325 msgstr[1] "%(count)s сообщения"
@@ -329,9 +327,7 b' msgstr[2] "%(count)s \xd1\x81\xd0\xbe\xd0\xbe\xd0\xb1\xd1\x89\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb9"'
329
327
330 #: templates/boards/post.html:106
328 #: templates/boards/post.html:106
331 #, python-format
329 #, python-format
332 #| msgid "%(count)s message,"
330 msgid "%(count)s image"
333 #| msgid_plural "%(count)s messages,"
334 msgid "%(count)s image,"
335 msgid_plural "%(count)s images"
331 msgid_plural "%(count)s images"
336 msgstr[0] "%(count)s изображение"
332 msgstr[0] "%(count)s изображение"
337 msgstr[1] "%(count)s изображения"
333 msgstr[1] "%(count)s изображения"
@@ -427,15 +423,22 b' msgstr "\xd0\x93\xd0\xb0\xd0\xbb\xd0\xb5\xd1\x80\xd0\xb5\xd1\x8f"'
427 msgid "Tree"
423 msgid "Tree"
428 msgstr "Дерево"
424 msgstr "Дерево"
429
425
430 #: templates/boards/thread.html:34
426 #: templates/boards/thread.html:36
431 msgid "messages"
427 #| msgid "messages"
432 msgstr "сообщений"
428 msgid "message"
429 msgid_plural "messages"
430 msgstr[0] "сообщение"
431 msgstr[1] "сообщения"
432 msgstr[2] "сообщений"
433
433
434 #: templates/boards/thread.html:35
434 #: templates/boards/thread.html:39
435 msgid "images"
435 msgid "image"
436 msgstr "изображений"
436 msgid_plural "images"
437 msgstr[0] "изображение"
438 msgstr[1] "изображения"
439 msgstr[2] "изображений"
437
440
438 #: templates/boards/thread.html:36
441 #: templates/boards/thread.html:41
439 msgid "Last update: "
442 msgid "Last update: "
440 msgstr "Последнее обновление: "
443 msgstr "Последнее обновление: "
441
444
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -8,7 +8,7 b' msgid ""'
8 msgstr ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2014-07-02 13:26+0300\n"
11 "POT-Creation-Date: 2015-09-04 18:47+0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,14 +19,37 b' msgstr ""'
19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
20 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
20 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
21
21
22 #: static/js/refpopup.js:58
22 #: static/js/3party/jquery-ui.min.js:8
23 msgid "'"
24 msgstr ""
25
26 #: static/js/refpopup.js:72
23 msgid "Loading..."
27 msgid "Loading..."
24 msgstr "Загрузка..."
28 msgstr "Загрузка..."
25
29
26 #: static/js/refpopup.js:77
30 #: static/js/refpopup.js:91
27 msgid "Post not found"
31 msgid "Post not found"
28 msgstr "Сообщение не найдено"
32 msgstr "Сообщение не найдено"
29
33
30 #: static/js/thread_update.js:279
34 #: static/js/thread_update.js:261
35 msgid "message"
36 msgid_plural "messages"
37 msgstr[0] "сообщение"
38 msgstr[1] "сообщения"
39 msgstr[2] "сообщений"
40
41 #: static/js/thread_update.js:262
42 msgid "image"
43 msgid_plural "images"
44 msgstr[0] "изображение"
45 msgstr[1] "изображения"
46 msgstr[2] "изображений"
47
48 #: static/js/thread_update.js:445
31 msgid "Sending message..."
49 msgid "Sending message..."
32 msgstr "Отправка сообщения..." No newline at end of file
50 msgstr "Отправка сообщения..."
51
52 #: static/js/thread_update.js:449
53 msgid "Server error!"
54 msgstr "Ошибка сервера!"
55
@@ -102,11 +102,10 b' function connectWebsocket() {'
102 * missed.
102 * missed.
103 */
103 */
104 function getThreadDiff() {
104 function getThreadDiff() {
105 var lastUpdateTime = $('.metapanel').attr('data-last-update');
105 var all_posts = $('.post');
106 var lastPostId = $('.post').last().attr('id');
107
106
108 var uids = '';
107 var uids = '';
109 var posts = $('.post');
108 var posts = all_posts;
110 for (var i = 0; i < posts.length; i++) {
109 for (var i = 0; i < posts.length; i++) {
111 uids += posts[i].getAttribute('data-uid') + ' ';
110 uids += posts[i].getAttribute('data-uid') + ' ';
112 }
111 }
@@ -244,8 +243,10 b' function updateMetadataPanel() {'
244 var replyCountField = $('#reply-count');
243 var replyCountField = $('#reply-count');
245 var imageCountField = $('#image-count');
244 var imageCountField = $('#image-count');
246
245
247 replyCountField.text(getReplyCount());
246 var replyCount = getReplyCount();
248 imageCountField.text(getImageCount());
247 replyCountField.text(replyCount);
248 var imageCount = getImageCount();
249 imageCountField.text(imageCount);
249
250
250 var lastUpdate = $('.post:last').children('.post-info').first()
251 var lastUpdate = $('.post:last').children('.post-info').first()
251 .children('.pub_time').first().html();
252 .children('.pub_time').first().html();
@@ -257,6 +258,9 b' function updateMetadataPanel() {'
257
258
258 blink(replyCountField);
259 blink(replyCountField);
259 blink(imageCountField);
260 blink(imageCountField);
261
262 $('#message-count-text').text(ngettext('message', 'messages', replyCount));
263 $('#image-count-text').text(ngettext('image', 'images', imageCount));
260 }
264 }
261
265
262 /**
266 /**
@@ -380,9 +384,6 b' function replacePartial(oldNode, newNode'
380 // Replace children
384 // Replace children
381 var children = oldNode.children();
385 var children = oldNode.children();
382 if (children.length == 0) {
386 if (children.length == 0) {
383 console.log(oldContent);
384 console.log(newContent)
385
386 oldNode.replaceWith(newNode);
387 oldNode.replaceWith(newNode);
387 } else {
388 } else {
388 var newChildren = newNode.children();
389 var newChildren = newNode.children();
@@ -426,7 +427,7 b' function updateNodeAttr(oldNode, newNode'
426 var newAttr = newNode.attr(attrName);
427 var newAttr = newNode.attr(attrName);
427 if (oldAttr != newAttr) {
428 if (oldAttr != newAttr) {
428 oldNode.attr(attrName, newAttr);
429 oldNode.attr(attrName, newAttr);
429 };
430 }
430 }
431 }
431
432
432 $(document).ready(function(){
433 $(document).ready(function(){
@@ -98,8 +98,8 b''
98 {% if is_opening %}
98 {% if is_opening %}
99 <div class="metadata">
99 <div class="metadata">
100 {% if is_opening and need_open_link %}
100 {% if is_opening and need_open_link %}
101 {% blocktrans count count=thread.get_reply_count %}{{ count }} message,{% plural %}{{ count }} messages{% endblocktrans %},
101 {% blocktrans count count=thread.get_reply_count %}{{ count }} message{% plural %}{{ count }} messages{% endblocktrans %},
102 {% blocktrans count count=thread.get_images_count %}{{ count }} image,{% plural %}{{ count }} images{% endblocktrans %}.
102 {% blocktrans count count=thread.get_images_count %}{{ count }} image{% plural %}{{ count }} images{% endblocktrans %}.
103 {% endif %}
103 {% endif %}
104 <span class="tags">
104 <span class="tags">
105 {{ thread.get_tag_url_list|safe }}
105 {{ thread.get_tag_url_list|safe }}
@@ -31,8 +31,13 b''
31 data-ws-host="{{ ws_host }}"
31 data-ws-host="{{ ws_host }}"
32 data-ws-port="{{ ws_port }}">
32 data-ws-port="{{ ws_port }}">
33
33
34 <span id="reply-count">{{ thread.get_reply_count }}</span>{% if thread.has_post_limit %}/{{ thread.max_posts }}{% endif %} {% trans 'messages' %},
34 {% with replies_count=thread.get_reply_count%}
35 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
35 <span id="reply-count">{{ thread.get_reply_count }}</span>{% if thread.has_post_limit %}/{{ thread.max_posts }}{% endif %}
36 <span id="message-count-text">{% blocktrans count repliess_count=replies_count %}message{% plural %}messages{% endblocktrans %}</span>,
37 {% endwith %}
38 {% with images_count=thread.get_images_count%}
39 <span id="image-count">{{ images_count }}</span> <span id="image-count-text">{% blocktrans count count=images_count %}image{% plural %}images{% endblocktrans %}</span>.
40 {% endwith %}
36 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time }}</time></span>
41 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time }}</time></span>
37 [<a href="rss/">RSS</a>]
42 [<a href="rss/">RSS</a>]
38 </span>
43 </span>
General Comments 0
You need to be logged in to leave comments. Login now