diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/app.ts | 6 | ||||
-rw-r--r-- | src/routes/frontend.ts | 3 |
2 files changed, 2 insertions, 7 deletions
@@ -125,12 +125,6 @@ async function initializeApp() { console.error('handlebars-i18next helper is not properly loaded'); } - - (hbsInstance.handlebars as typeof Handlebars).registerHelper('pluralize', function(count: number, key: string, options: any) { - const translation = i18next.t(key, { count: count }); - return translation; - }); - app.engine("handlebars", hbsInstance.engine); app.set("view engine", "handlebars"); app.set("hbsInstance", hbsInstance); diff --git a/src/routes/frontend.ts b/src/routes/frontend.ts index 96d7587..40b5393 100644 --- a/src/routes/frontend.ts +++ b/src/routes/frontend.ts @@ -19,6 +19,7 @@ import MagicLink from "../models/MagicLink.js"; import { getConfigMiddleware } from "../lib/middleware.js"; import { getMessage } from "../util/messages.js"; import { EventListEvent, bucketEventsByMonth } from "../lib/event.js"; +import i18next from "i18next"; const router = Router(); @@ -257,7 +258,7 @@ router.get("/:eventID", async (req: Request, res: Response) => { el.id = el._id; } if (el.number && el.number > 1) { - el.name = `${el.name} (${el.number} people)`; + el.name = `${el.name} ${i18next.t("frontend.elnumber", { count: el.number })}`; } return { ...el, |