diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-01-25 22:44:38 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-01-25 22:44:38 -0800 |
commit | b9ad86071622b0e12cc5ff7fccc4e094785891fb (patch) | |
tree | cb566c0c5005b48d5260a56786a0e0e123b58548 /fatcat_scholar/web.py | |
parent | 9e73da0e40f7cf38de0ae3413fdf0d202493525d (diff) | |
download | fatcat-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.py | 2 |
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 |