Make 'permanent' / 'temporary' label on redirects translatable; don't translate the classname

Thanks to leo_naeka for reporting!
pull/2691/head
Matt Westcott 2016-06-07 16:58:09 +01:00
rodzic b34f920832
commit aaceb9b08f
4 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -19,6 +19,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)

Wyświetl plik

@ -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)

Wyświetl plik

@ -40,9 +40,9 @@ class Redirect(models.Model):
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):

Wyświetl plik

@ -36,7 +36,7 @@
{{ 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>