summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/app.ts6
-rw-r--r--src/routes/frontend.ts3
2 files changed, 2 insertions, 7 deletions
diff --git a/src/app.ts b/src/app.ts
index 9828905..9301484 100755
--- a/src/app.ts
+++ b/src/app.ts
@@ -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,