Splited stirng into two then fixed pluralization error.

This commit is contained in:
Ritik Ranjan 2023-01-28 21:11:20 +05:30
parent fc599f8b9a
commit e5e9e807ca
2 changed files with 8 additions and 4 deletions

View file

@ -17,7 +17,14 @@
{% if site.imports_enabled %}
{% if import_size_limit and import_limit_reset %}
<div class="notification">
<p>{% blocktrans %}Currently you are allowed to import {{ import_size_limit }} {{book_noun}} every {{ import_limit_reset }} {{day_noun}}.{% endblocktrans %}</p>
<p>
{% blocktrans count books=import_size_limit%}
Currently you are allowed to import {{ import_size_limit }} {{books}}
{% endblocktrans %}
{% blocktrans count days=import_limit_reset%}
every {{ import_limit_reset }} {{days}}.
{% endblocktrans %}
</p>
<p>{% blocktrans %}You have {{ allowed_imports }} left.{% endblocktrans %}</p>
</div>
{% endif %}

View file

@ -64,9 +64,6 @@ class Import(View):
data["import_limit_reset"] = site_settings.import_limit_reset
data["allowed_imports"] = site_settings.import_size_limit - imported_books
data["book_noun"] = "books" if site_settings.import_size_limit > 1 else 'book'
data["day_noun"] = "days" if site_settings.import_limit_reset > 1 else 'day'
return TemplateResponse(request, "import/import.html", data)
def post(self, request):