Skip to content

Commit

Permalink
Make 'permanent' / 'temporary' label on redirects translatable; don't…
Browse files Browse the repository at this point in the history
… translate the classname

Thanks to leo_naeka for reporting!
  • Loading branch information
gasman committed Jun 7, 2016
1 parent b6ae7d6 commit 7c2130f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Changelog
* Fix: Now page chooser (in a rich text editor) opens up at the link's parent page, rather than at the page itself (Matt Westcott)
* Fix: Reverted fix for explorer menu scrolling with page content, as it blocked access to menus that exceed screen height
* Fix: Image listing in the image chooser no longer becomes unpaginated after an invalid upload form submission (Stephen Rice)
* Fix: Applied correct translation tags for 'permanent' / 'temporary' labels on redirects (Matt Westcott)


1.5 (31.05.2016)
Expand Down
1 change: 1 addition & 0 deletions docs/releases/1.5.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Bug fixes
* Reverted fix for explorer menu scrolling with page content, as it blocked access to menus that exceed screen height
* Image listing in the image chooser no longer becomes unpaginated after an invalid upload form submission (Stephen Rice)
* Confirmation message on the ModelAdmin delete view no longer errors if the model's string representation depends on the primary key (Yannick Chabbert)
* Applied correct translation tags for 'permanent' / 'temporary' labels on redirects (Matt Westcott)
4 changes: 2 additions & 2 deletions wagtail/wagtailredirects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def link(self):

def get_is_permanent_display(self):
if self.is_permanent:
return "permanent"
return _("permanent")
else:
return "temporary"
return _("temporary")

@classmethod
def get_for_site(cls, site=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2><a href="{% url 'wagtailredirects:edit' redirect.id %}" title="{% trans 'Edi
{{ redirect.link }}
{% endif %}
</td>
<td class="type"><div class="status-tag {% if redirect.get_is_permanent_display == "permanent" %}{% trans "primary" %}{% endif %}">{{ redirect.get_is_permanent_display }}</div></td>
<td class="type"><div class="status-tag {% if redirect.is_permanent %}primary{% endif %}">{{ redirect.get_is_permanent_display }}</div></td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 7c2130f

Please sign in to comment.