Merge pull request #3 from siterra/master
Russian translation complete + no *.mo files in .gitignore
This commit is contained in:
commit
272bd8e3ca
8 changed files with 66 additions and 23 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -26,9 +26,6 @@ pip-log.txt
|
||||||
.tox
|
.tox
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
|
|
||||||
# Mr Developer
|
# Mr Developer
|
||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
.project
|
.project
|
||||||
|
|
BIN
djangocms_blog/locale/ru/LC_MESSAGES/django.mo
Normal file
BIN
djangocms_blog/locale/ru/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
|
@ -7,13 +7,16 @@ msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2014-02-27 15:00+0100\n"
|
"POT-Creation-Date: 2014-02-27 15:00+0100\n"
|
||||||
"PO-Revision-Date: 2014-02-27 15:08+0100\n"
|
"PO-Revision-Date: 2014-02-27 16:45+0300\n"
|
||||||
"Last-Translator: Max Vyaznikov <maxvyaznikov@gmail.com>\n"
|
"Last-Translator: Max Vyaznikov <maxvyaznikov@gmail.com>\n"
|
||||||
"Language: ru\n"
|
"Language: ru\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
|
"Plural-Forms: nplurals=3; plural=((((n%10)==1)&&((n%100)!=11))?(0):(((((n%10)"
|
||||||
|
">=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"X-Generator: Poedit 1.5.4\n"
|
||||||
|
|
||||||
#: cms_app.py:8 cms_plugins.py:30 cms_plugins.py:43 cms_plugins.py:54
|
#: cms_app.py:8 cms_plugins.py:30 cms_plugins.py:43 cms_plugins.py:54
|
||||||
#: cms_plugins.py:65 cms_toolbar.py:13
|
#: cms_plugins.py:65 cms_toolbar.py:13
|
||||||
|
@ -70,10 +73,30 @@ msgstr "время изменения"
|
||||||
msgid "name"
|
msgid "name"
|
||||||
msgstr "название"
|
msgstr "название"
|
||||||
|
|
||||||
#: models.py:33 models.py:84
|
#: models.py:75
|
||||||
|
msgid "Main image"
|
||||||
|
msgstr "Картинка для статьи"
|
||||||
|
|
||||||
|
#: models.py:77
|
||||||
|
msgid "Main image thumbnail"
|
||||||
|
msgstr "Уменьшенная копия"
|
||||||
|
|
||||||
|
#: models.py:81
|
||||||
|
msgid "Main image full"
|
||||||
|
msgstr "Полный размер"
|
||||||
|
|
||||||
|
#: models.py:86
|
||||||
|
msgid "Title"
|
||||||
|
msgstr "Заголовок"
|
||||||
|
|
||||||
|
#: models.py:33 models.py:87
|
||||||
msgid "slug"
|
msgid "slug"
|
||||||
msgstr "URL"
|
msgstr "URL"
|
||||||
|
|
||||||
|
#: models.py:88
|
||||||
|
msgid "Text"
|
||||||
|
msgstr "Текст"
|
||||||
|
|
||||||
#: models.py:40
|
#: models.py:40
|
||||||
msgid "blog category"
|
msgid "blog category"
|
||||||
msgstr "категория блога"
|
msgstr "категория блога"
|
||||||
|
@ -82,6 +105,10 @@ msgstr "категория блога"
|
||||||
msgid "blog categories"
|
msgid "blog categories"
|
||||||
msgstr "категории блога"
|
msgstr "категории блога"
|
||||||
|
|
||||||
|
#: models.py:64
|
||||||
|
msgid "Author"
|
||||||
|
msgstr "Автор"
|
||||||
|
|
||||||
#: models.py:67
|
#: models.py:67
|
||||||
msgid "Published Since"
|
msgid "Published Since"
|
||||||
msgstr "Опубликована с"
|
msgstr "Опубликована с"
|
||||||
|
@ -90,6 +117,10 @@ msgstr "Опубликована с"
|
||||||
msgid "Published Until"
|
msgid "Published Until"
|
||||||
msgstr "Опубликована до"
|
msgstr "Опубликована до"
|
||||||
|
|
||||||
|
#: models.py:72
|
||||||
|
msgid "Publish"
|
||||||
|
msgstr "Показывать на сайте"
|
||||||
|
|
||||||
#: models.py:72
|
#: models.py:72
|
||||||
msgid "category"
|
msgid "category"
|
||||||
msgstr "категория"
|
msgstr "категория"
|
||||||
|
@ -183,7 +214,7 @@ msgstr "продолжение"
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "1 article"
|
msgid "1 article"
|
||||||
msgid_plural "%(articles)s articles"
|
msgid_plural "%(articles)s articles"
|
||||||
msgstr[0] "1 статья"
|
msgstr[0] "%(articles)s статья"
|
||||||
msgstr[1] "%(articles)s статьи"
|
msgstr[1] "%(articles)s статьи"
|
||||||
msgstr[2] "%(articles)s статей"
|
msgstr[2] "%(articles)s статей"
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Post(TranslatableModel):
|
||||||
"""
|
"""
|
||||||
Blog post
|
Blog post
|
||||||
"""
|
"""
|
||||||
author = models.ForeignKey(User, null=True, blank=True)
|
author = models.ForeignKey(User, verbose_name=_('Author'), null=True, blank=True)
|
||||||
|
|
||||||
date_created = models.DateTimeField(auto_now_add=True)
|
date_created = models.DateTimeField(auto_now_add=True)
|
||||||
date_modified = models.DateTimeField(auto_now=True)
|
date_modified = models.DateTimeField(auto_now=True)
|
||||||
|
@ -69,21 +69,23 @@ class Post(TranslatableModel):
|
||||||
default=timezone.now)
|
default=timezone.now)
|
||||||
date_published_end = models.DateTimeField(_('Published Until'), null=True,
|
date_published_end = models.DateTimeField(_('Published Until'), null=True,
|
||||||
blank=True)
|
blank=True)
|
||||||
publish = models.BooleanField(default=False)
|
publish = models.BooleanField(_('Publish'), default=False)
|
||||||
categories = models.ManyToManyField(BlogCategory, verbose_name=_('category'),
|
categories = models.ManyToManyField(BlogCategory, verbose_name=_('category'),
|
||||||
related_name='blog_posts',)
|
related_name='blog_posts',)
|
||||||
main_image = FilerImageField(blank=True, null=True)
|
main_image = FilerImageField(verbose_name=_('Main image'), blank=True, null=True)
|
||||||
main_image_thumbnail = models.ForeignKey(ThumbnailOption,
|
main_image_thumbnail = models.ForeignKey(ThumbnailOption,
|
||||||
|
verbose_name=_('Main image thumbnail'),
|
||||||
related_name='blog_post_thumbnail',
|
related_name='blog_post_thumbnail',
|
||||||
blank=True, null=True)
|
blank=True, null=True)
|
||||||
main_image_full = models.ForeignKey(ThumbnailOption,
|
main_image_full = models.ForeignKey(ThumbnailOption,
|
||||||
|
verbose_name=_('Main image full'),
|
||||||
related_name='blog_post_full',
|
related_name='blog_post_full',
|
||||||
blank=True, null=True)
|
blank=True, null=True)
|
||||||
|
|
||||||
translations = TranslatedFields(
|
translations = TranslatedFields(
|
||||||
title=models.CharField(max_length=255),
|
title=models.CharField(_('Title'), max_length=255),
|
||||||
slug=models.SlugField(_('slug'), blank=True, db_index=True),
|
slug=models.SlugField(_('slug'), blank=True, db_index=True),
|
||||||
abstract=HTMLField(),
|
abstract=HTMLField(_('Text')),
|
||||||
meta={'unique_together': (('language_code', 'slug'),)}
|
meta={'unique_together': (('language_code', 'slug'),)}
|
||||||
)
|
)
|
||||||
content = PlaceholderField("post_content")
|
content = PlaceholderField("post_content")
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
BLOG_IMAGE_THUMBNAIL_SIZE = {
|
from django.conf import settings
|
||||||
|
|
||||||
|
BLOG_IMAGE_THUMBNAIL_SIZE = getattr(settings, 'BLOG_IMAGE_THUMBNAIL_SIZE', {
|
||||||
'size': '120x120',
|
'size': '120x120',
|
||||||
'crop': True,
|
'crop': True,
|
||||||
'upscale': False
|
'upscale': False
|
||||||
}
|
})
|
||||||
|
|
||||||
BLOG_IMAGE_FULL_SIZE = {
|
BLOG_IMAGE_FULL_SIZE = getattr(settings, 'BLOG_IMAGE_FULL_SIZE', {
|
||||||
'size': '640x120',
|
'size': '640x120',
|
||||||
'crop': True,
|
'crop': True,
|
||||||
'upscale': False
|
'upscale': False
|
||||||
}
|
})
|
||||||
|
|
||||||
BLOG_TAGCLOUD_MIN = 1
|
BLOG_TAGCLOUD_MIN = getattr(settings, 'BLOG_TAGCLOUD_MIN', 1)
|
||||||
BLOG_TAGCLOUD_MAX = 10
|
BLOG_TAGCLOUD_MAX = getattr(settings, 'BLOG_TAGCLOUD_MAX', 10)
|
||||||
BLOG_PAGINATION = 10
|
BLOG_PAGINATION = getattr(settings, 'BLOG_PAGINATION', 10)
|
||||||
BLOG_LATEST_POSTS = 5
|
BLOG_LATEST_POSTS = getattr(settings, 'BLOG_LATEST_POSTS', 5)
|
||||||
|
BLOG_POSTS_LIST_TRUNCWORDS_COUNT = getattr(settings, 'BLOG_POSTS_LIST_TRUNCWORDS_COUNT', 100)
|
||||||
|
|
|
@ -33,7 +33,13 @@
|
||||||
<img src="{{ thumb.url }}" alt="{{ post.main_image.default_alt_text }}" width="{{ thumb.width }}" height="{{ thumb.height }}" />
|
<img src="{{ thumb.url }}" alt="{{ post.main_image.default_alt_text }}" width="{{ thumb.width }}" height="{{ thumb.height }}" />
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="blog-lead">{% render_model post "abstract" %}</div>
|
<div class="blog-lead">
|
||||||
|
{% if not TRUNCWORDS_COUNT %}
|
||||||
|
{% render_model post "abstract" %}
|
||||||
|
{% else %}
|
||||||
|
{% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
<footer class="read-more">
|
<footer class="read-more">
|
||||||
<a href="{{ post.get_absolute_url }}">{% trans "read more" %} »</a>
|
<a href="{{ post.get_absolute_url }}">{% trans "read more" %} »</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</header>
|
</header>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% for post in post_list %}
|
{% for post in post_list %}
|
||||||
{% include "djangocms_blog/includes/blog_item.html" with post=post image="true" %}
|
{% include "djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<p class="blog-empty">{% trans "No article found." %}</p>
|
<p class="blog-empty">{% trans "No article found." %}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -8,7 +8,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from django.views.generic import ListView, DetailView
|
from django.views.generic import ListView, DetailView
|
||||||
|
|
||||||
from .models import Post, BlogCategory
|
from .models import Post, BlogCategory
|
||||||
from .settings import BLOG_PAGINATION
|
from .settings import BLOG_PAGINATION, BLOG_POSTS_LIST_TRUNCWORDS_COUNT
|
||||||
|
|
||||||
|
|
||||||
class BaseBlogView(object):
|
class BaseBlogView(object):
|
||||||
|
@ -31,6 +31,10 @@ class PostListView(BaseBlogView, ListView):
|
||||||
template_name = "djangocms_blog/post_list.html"
|
template_name = "djangocms_blog/post_list.html"
|
||||||
paginate_by = BLOG_PAGINATION
|
paginate_by = BLOG_PAGINATION
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
context = super(PostListView, self).get_context_data(**kwargs)
|
||||||
|
context['TRUNCWORDS_COUNT'] = BLOG_POSTS_LIST_TRUNCWORDS_COUNT
|
||||||
|
return context
|
||||||
|
|
||||||
class PostDetailView(BaseBlogView, DetailView):
|
class PostDetailView(BaseBlogView, DetailView):
|
||||||
model = Post
|
model = Post
|
||||||
|
|
Loading…
Add table
Reference in a new issue