summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-05-24 12:49:21 +0200
committerAdam Tauber <asciimoo@gmail.com>2016-05-24 12:49:21 +0200
commitbd361e60d8d5d182e9f93fbd1e7b5c118531992f (patch)
tree0b8113c700076bd08f2ed104f8a35467502d47fc /searx/webapp.py
parentebc0bcb6125b8db57bcf02f215608cfa7b6e0319 (diff)
Revert "use ngettext for plurals"
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index b995e1fec..ed8ff1bd9 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -48,7 +48,7 @@ from flask import (
Flask, request, render_template, url_for, Response, make_response,
redirect, send_from_directory
)
-from flask.ext.babel import Babel, gettext, ngettext, format_date
+from flask.ext.babel import Babel, gettext, format_date
from searx import settings, searx_dir
from searx.engines import (
categories, engines, get_engines_stats, engine_shortcuts
@@ -411,10 +411,9 @@ def index():
minutes = int((timedifference.seconds / 60) % 60)
hours = int(timedifference.seconds / 60 / 60)
if hours == 0:
- result['publishedDate'] = ngettext(u'{minutes} minute ago', u'{minutes} minutes ago', minutes).format(minutes=minutes) # noqa
+ result['publishedDate'] = gettext(u'{minutes} minute(s) ago').format(minutes=minutes)
else:
- result['publishedDate'] = ngettext(u'{hours} hour, ', u'{hours} hours, ', hours).format(hours=hours) # noqa
- result['publishedDate'] += ngettext(u'{minutes} minute ago', u'{minutes} minutes ago', minutes).format(minutes=minutes) # noqa
+ result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa
else:
result['publishedDate'] = format_date(result['publishedDate'])