summaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/web.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-01-25 22:44:38 -0800
committerBryan Newbold <bnewbold@archive.org>2021-01-25 22:44:38 -0800
commitb9ad86071622b0e12cc5ff7fccc4e094785891fb (patch)
treecb566c0c5005b48d5260a56786a0e0e123b58548 /fatcat_scholar/web.py
parent9e73da0e40f7cf38de0ae3413fdf0d202493525d (diff)
downloadfatcat-scholar-b9ad86071622b0e12cc5ff7fccc4e094785891fb.tar.gz
fatcat-scholar-b9ad86071622b0e12cc5ff7fccc4e094785891fb.zip
i18n: use babel.numbers.format_number() in web interface
Diffstat (limited to 'fatcat_scholar/web.py')
-rw-r--r--fatcat_scholar/web.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py
index 133ddce..124e269 100644
--- a/fatcat_scholar/web.py
+++ b/fatcat_scholar/web.py
@@ -8,6 +8,7 @@ import logging
from typing import Optional, Any, List, Dict
from pydantic import BaseModel
+import babel.numbers
import babel.support
from fastapi import FastAPI, APIRouter, Request, Depends, Response, HTTPException
from fastapi.staticfiles import StaticFiles
@@ -160,6 +161,7 @@ def load_i18n_templates() -> Any:
templates.env.lstrip_blocks = True
# pass-through application settings to be available in templates
templates.env.globals["settings"] = settings
+ templates.env.globals["babel_numbers"] = babel.numbers
d[lang_opt] = templates
return d