From b9ad86071622b0e12cc5ff7fccc4e094785891fb Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 25 Jan 2021 22:44:38 -0800 Subject: i18n: use babel.numbers.format_number() in web interface --- fatcat_scholar/web.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fatcat_scholar/web.py') 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 -- cgit v1.2.3