Merge branch 'develop' of github.com:mbi/django-rosetta into pr/212

This commit is contained in:
Marco Bonetti 2019-01-18 11:10:31 +01:00
commit 39c266d8c5
8 changed files with 19 additions and 7 deletions

View file

@ -11,6 +11,8 @@ matrix:
env: TOX_ENV=py36-django20
- python: "3.6"
env: TOX_ENV=py36-django21
- python: "3.6"
env: TOX_ENV=py36-django22
install:
- pip install tox

View file

@ -5,7 +5,9 @@ Version 0.9.1 (unreleased)
--------------------------
* Removed old compatibility code for Django < 1.11 (#205, thanks @claudep)
* Allow overriding rosetta login url (#210, thanks @izimobil)
* Test against Django 2.2
* Optional line number in the occurrences column (#215, thanks @pauloxnet)
* Add search in msgctxt (#213, thanks @yakky)
Version 0.9.0
-------------

View file

@ -130,7 +130,7 @@
</td>
<td class="location">
{% for fn,lineno in message.occurrences %}
<code{% if forloop.counter|gt:"3" %} class="hide"{% endif %}>{{ fn }}:{{lineno}}</code>
<code{% if forloop.counter|gt:"3" %} class="hide"{% endif %}>{{ fn }}{% if lineno %}:{{lineno}}{% endif %}</code>
{% endfor %}
{% if message.occurrences|length|gt:"3" %}
<a href="#">&hellip; ({% blocktrans count message.occurrences|length|minus:"3" as more_count %}{{more_count}} more{% plural %}{{more_count}} more{% endblocktrans %})</a>

View file

@ -2,7 +2,7 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
msgid ""
msgstr ""
"Project-Id-Version: Rosetta\n"
@ -166,5 +166,6 @@ msgstr ""
#. Translators: consectetur adipisicing
#: templates/eiusmod/tempor.html:43
msgctxt "purus pellentesque"
msgid "Lorem ipsum"
msgstr "dolor sit amet"

View file

@ -943,6 +943,10 @@ class RosettaTestCase(TestCase):
r = self.client.get(url % 'adipisicing')
self.assertContains(r, 'Lorem')
# Search context
r = self.client.get(url % 'pellentesque')
self.assertContains(r, 'Lorem')
def test_45_issue186_plural_msg_search(self):
"""Confirm that search of the .po file works for plurals.
"""

View file

@ -601,6 +601,7 @@ class TranslationFormView(RosettaFileLevelMixin, TemplateView):
def concat_entry(e):
return (six.text_type(e.msgstr) +
six.text_type(e.msgid) +
six.text_type(e.msgctxt) +
six.text_type(e.comment) +
u''.join([o[0] for o in e.occurrences]) +
six.text_type(e.msgid_plural) +

View file

@ -44,6 +44,7 @@ INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'rosetta',
]

View file

@ -2,8 +2,8 @@
envlist =
flake8,
{py27,py36}-django111,
py36-django{20,21},
py37-django{20,21},
py36-django{20,21,22},
py37-django{20,21,22},
gettext,docs
skipsdist = True
@ -21,10 +21,11 @@ deps =
django111: Django==1.11.*
django20: Django==2.0.*
django21: Django>=2.1a1,<=2.1.99
django22: Django>=2.2a1,<=2.2.99
py27-django{17,18,19,110,111}: python-memcached
py36-django{17,18,19,110,111,20,21}: python3-memcached
py37-django{20,21}: python3-memcached
py36-django{17,18,19,110,111,20,21,22}: python3-memcached
py37-django{20,21,22}: python3-memcached
# py27-django18: pudb
requests
polib>=1.1.0