Remove inflect dependency
This commit is contained in:
parent
7132edc1f1
commit
3e3dfc5056
1
Pipfile
1
Pipfile
@ -26,7 +26,6 @@ azure-storage = "*"
|
||||
azure-storage-common = "*"
|
||||
boto3 = "*"
|
||||
celery = "*"
|
||||
inflect = "*"
|
||||
|
||||
[dev-packages]
|
||||
bandit = "*"
|
||||
|
@ -1,6 +1,5 @@
|
||||
import re
|
||||
import datetime
|
||||
import inflect
|
||||
from atst.utils.localization import translate
|
||||
from flask import render_template
|
||||
from jinja2 import contextfilter
|
||||
@ -68,14 +67,6 @@ def renderAuditEvent(event):
|
||||
return render_template("audit_log/events/default.html", event=event)
|
||||
|
||||
|
||||
def numberToWords(integer):
|
||||
return inflect.engine().number_to_words(integer)
|
||||
|
||||
|
||||
def pluralize(word, number):
|
||||
return inflect.engine().plural(word, number)
|
||||
|
||||
|
||||
def register_filters(app):
|
||||
app.jinja_env.filters["iconSvg"] = iconSvg
|
||||
app.jinja_env.filters["dollars"] = dollars
|
||||
@ -85,8 +76,6 @@ def register_filters(app):
|
||||
app.jinja_env.filters["pageWindow"] = pageWindow
|
||||
app.jinja_env.filters["renderAuditEvent"] = renderAuditEvent
|
||||
app.jinja_env.filters["withExtraParams"] = with_extra_params
|
||||
app.jinja_env.filters["numberToWords"] = numberToWords
|
||||
app.jinja_env.filters["pluralize"] = pluralize
|
||||
|
||||
@contextfilter
|
||||
def translateWithoutCache(context, *kwargs):
|
||||
|
@ -252,7 +252,11 @@
|
||||
|
||||
{% if user_can(permissions.DELETE_APPLICATION) %}
|
||||
{% set env_count = application.environments | length %}
|
||||
{% set pluralized_env = "environment" | pluralize(env_count) %}
|
||||
{% if env_count == 1 %}
|
||||
{% set pluralized_env = "environment" %}
|
||||
{% else %}
|
||||
{% set pluralized_env = "environments" %}
|
||||
{% endif %}
|
||||
|
||||
<div class='subheading'>
|
||||
{{ "portfolios.applications.delete.subheading" | translate }}
|
||||
@ -262,7 +266,7 @@
|
||||
<div class="panel__content">
|
||||
<div class="form-row">
|
||||
<div class="form-col form-col--two-thirds">
|
||||
{{ "portfolios.applications.delete.panel_text" | translate({"name": application.name, "env_count": env_count | numberToWords, "pluralized_env": pluralized_env}) | safe }}
|
||||
{{ "portfolios.applications.delete.panel_text" | translate({"name": application.name, "env_count": env_count , "pluralized_env": pluralized_env}) | safe }}
|
||||
</div>
|
||||
<div class="form-col form-col--third">
|
||||
<div class="usa-input">
|
||||
|
Loading…
x
Reference in New Issue
Block a user