Convert templates to use translate instead of localize

Not sure what the difference is but most things tend to use translate.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-24 15:56:36 -07:00
parent e30012d6d0
commit 412045e015
6 changed files with 24 additions and 22 deletions

View File

@@ -1,11 +1,11 @@
{% extends "board/base.html" %}
{% load l10n %}
{% load i18n %}
{# Title #}
{% block title %}{% localize on %}Ban success{% endlocalize %}{% endblock %}
{% block title %}{% translate "Ban success" %}{% endblock %}
{# Body #}
{% block content %}
<div class="row" id="message">
{% localize on %}A ban has been created. This window will close in 1 second.{% endlocalize %}
{% translate "A ban has been created. This window will close in 1 second." %}
</div>
<script>

View File

@@ -1,6 +1,6 @@
{% extends "board/base.html" %}
{% load post_body %}
{% load l10n %}
{% load i18n %}
{% block title %}
{% with title=board.url %}
@@ -23,7 +23,7 @@
<div class="column">&nbsp;</div>
<div class="column">
<div class="row">
<h2>{% localize on %}Create a new thread{% endlocalize %}</h2>
<h2>{% translate "Create a new thread" %}</h2>
</div>
<div class="row">
<form method="post" action="{% url 'board:board_detail' url=board.url %}" enctype="multipart/form-data">
@@ -33,7 +33,7 @@
<tr>
<th>&nbsp;</th>
<td>
{% localize on %}Max image size{% endlocalize %}:
{% translate "Max image size" %}:
{{ max_upload_size|measure_bytes }}
</td>
</tr>
@@ -67,7 +67,7 @@
<div class="row pagination">
{% if current_page > 1 %}
{% with prev_page=current_page|add:"-1" %}
<a href="{% url 'board:board_detail' board.url prev_page %}">{% localize on %}Prev{% endlocalize %}</a>
<a href="{% url 'board:board_detail' board.url prev_page %}">{% translate "Prev" %}</a>
{% endwith %}
{% endif %}
[
@@ -81,7 +81,7 @@
]
{% if current_page < last_page %}
{% with next_page=current_page|add:"1" %}
<a href="{% url 'board:board_detail' board.url next_page %}">{% localize on %}Next{% endlocalize %}</a>
<a href="{% url 'board:board_detail' board.url next_page %}">{% translate "Next" %}</a>
{% endwith %}
{% endif %}
</div>

View File

@@ -1,6 +1,6 @@
{% extends "board/base.html" %}
{% load post_body %}
{% load l10n %}
{% load i18n %}
{% block title %}
{% with title=board.url %}
@@ -29,7 +29,7 @@
<tr>
<th>&nbsp;</th>
<td>
{% localize on %}Max image size{% endlocalize %}:
{% translate "Max image size" %}:
{{ max_upload_size|measure_bytes }}
</td>
</tr>
@@ -40,7 +40,7 @@
<div class="column">&nbsp;</div>
</div>
{# return links #}
[ <a href="{% url 'board:board_detail' board.url %}">{% localize on %}Return{% endlocalize %}</a> ]
[ <a href="{% url 'board:board_detail' board.url %}">{% translate "Return" %}</a> ]
<hr />
{# posts #}
<div class="row post">

View File

@@ -1,5 +1,5 @@
{% load post_body %}
{% load l10n %}
{% load i18n %}
<div
id="p{{post.id}}"
data-report-url="{% url 'board:report_form' board.url post.id %}"
@@ -11,7 +11,7 @@
{% if post.thumbnail %}
{# Image info #}
<div class="post_image_info">
{% localize on %}File{% endlocalize %}:
{% translate "File" %}
<a href="{{post.image.url}}" target="_blank">{{post.original_image_name}}</a>
({{post.image.size|measure_bytes}}, {{post.image_width}}x{{post.image_height}})
</div>
@@ -30,12 +30,14 @@
{% if post.subject %}
<span class="post_subject">{{post.subject}}</span>
{% endif %}
{% localize on %}by{% endlocalize %}
{% blocktranslate %}
by
<span class="post_name">{{post.name|default:"Anonymous"}}</span>
{% localize on %}at{% endlocalize %}
at
{{post.created}}
{% endblocktranslate %}
{% if reply_link %}
[<a href="{{post.get_absolute_url}}">{% localize on %}Reply{% endlocalize %}</a>]
[<a href="{{post.get_absolute_url}}">{% translate "Reply" %}</a>]
{% endif %}
<a href="#" class="post_menu_button" data-id="post_menu_button"></a>
@@ -44,7 +46,7 @@
{% if replies_elided > 0 %}
<br/>
<span class="replies_elided">
({% localize on %}{{replies_elided}} replies elided, click reply to view{% endlocalize %})
({% blocktranslate %}{{replies_elided}} replies elided, click reply to view{% endblocktranslate %})
</span>
{% endif %}

View File

@@ -1,7 +1,7 @@
{% extends "board/base.html" %}
{% load l10n %}
{% load i18n %}
{# Title #}
{% block title %}{% localize on %}Reporting post {{post.id}}{% endlocalize %}{% endblock %}
{% block title %}{% blocktranslate %}Reporting post {{post.id}}{% endblocktranslate %}{% endblock %}
{# Body #}
{% block content %}
<div class="row">

View File

@@ -1,11 +1,11 @@
{% extends "board/base.html" %}
{% load l10n %}
{% load i18n %}
{# Title #}
{% block title %}{% localize on %}Report success{% endlocalize %}{% endblock %}
{% block title %}{% translate "Report success" %}{% endblock %}
{# Body #}
{% block content %}
<div class="row" id="message">
{% localize on %}Post reported. This window will close in 1 second.{% endlocalize %}
{% translate "Post reported. This window will close in 1 second." %}
</div>
<script>