Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Remove http backend (#1962)

Luke Vella9ddc26146b2d
diff --git a/apps/web/package.json b/apps/web/package.json
index 567a49a18..714f021d1 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -67,7 +67,6 @@
"hono": "^4.9.7",
"hono-rate-limiter": "^0.2.1",
"i18next": "^24.2.2",
- "i18next-http-backend": "^3.0.2",
"i18next-icu": "^2.3.0",
"i18next-resources-to-backend": "^1.2.1",
"ics": "^3.1.0",
diff --git a/apps/web/src/i18n/client.tsx b/apps/web/src/i18n/client.tsx
index 5cb8356de..caf0b24b2 100644
--- a/apps/web/src/i18n/client.tsx
+++ b/apps/web/src/i18n/client.tsx
@@ -1,5 +1,4 @@
"use client";
-import httpBackend from "i18next-http-backend";
import type React from "react";
import {
I18nextProvider,
@@ -24,9 +23,6 @@ export function I18nProvider({
const res = useAsync(async () => {
return await initI18next({
lng: locale,
- middleware: (i18n) => {
- i18n.use(httpBackend);
- },
});
});
diff --git a/apps/web/src/i18n/i18n.ts b/apps/web/src/i18n/i18n.ts
index 590a55175..2dcf322e2 100644
--- a/apps/web/src/i18n/i18n.ts
+++ b/apps/web/src/i18n/i18n.ts
@@ -1,6 +1,7 @@
-import type { i18n, Namespace } from "i18next";
+import type { Namespace } from "i18next";
import { createInstance } from "i18next";
import ICU from "i18next-icu";
+import resourcesToBackend from "i18next-resources-to-backend";
import { initReactI18next } from "react-i18next/initReactI18next";
import { getOptions } from "./settings";
@@ -8,14 +9,19 @@ import { getOptions } from "./settings";
export const initI18next = async ({
lng,
ns,
- middleware,
}: {
lng: string;
ns?: Namespace;
- middleware: (i18n: i18n) => void;
}) => {
- const i18nInstance = createInstance().use(initReactI18next).use(ICU);
- middleware(i18nInstance);
+ const i18nInstance = createInstance()
+ .use(initReactI18next)
+ .use(
+ resourcesToBackend(
+ (language: string, namespace: string) =>
+ import(`../../public/locales/${language}/${namespace}.json`),
+ ),
+ )
+ .use(ICU);
const t = await i18nInstance.init(getOptions(lng, ns));
return { t, i18n: i18nInstance };
};
diff --git a/apps/web/src/i18n/server.ts b/apps/web/src/i18n/server.ts
index 7df5337f5..7bd6b6a18 100644
--- a/apps/web/src/i18n/server.ts
+++ b/apps/web/src/i18n/server.ts
@@ -1,5 +1,3 @@
-import resourcesToBackend from "i18next-resources-to-backend";
-
import { defaultNS } from "@/i18n/settings";
import { initI18next } from "./i18n";
@@ -14,14 +12,6 @@ export async function getTranslation(localeOverride?: string) {
const { i18n } = await initI18next({
lng: locale,
- middleware: (i18n) => {
- i18n.use(
- resourcesToBackend(
- (language: string, namespace: string) =>
- import(`../../public/locales/${language}/${namespace}.json`),
- ),
- );
- },
});
return {
t: i18n.getFixedT(locale, defaultNS),
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f59895304..ab452087a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -80,7 +80,7 @@ importers:
version: 8.1.0([email protected])
'@vercel/analytics':
specifier: ^1.5.0
dayjs:
specifier: ^1.11.13
version: 1.11.13
@@ -119,7 +119,7 @@ importers:
next-seo:
specifier: ^6.1.0
react:
specifier: ^19.1.0
version: 19.1.0
@@ -316,9 +316,6 @@ importers:
i18next:
specifier: ^24.2.2
version: 24.2.3([email protected])
- i18next-http-backend:
- specifier: ^3.0.2
- version: 3.0.2
i18next-icu:
specifier: ^2.3.0
version: 2.3.0([email protected])
@@ -5640,9 +5637,6 @@ packages:
engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
hasBin: true
- resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==}
-
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
@@ -6560,9 +6554,6 @@ packages:
resolution: {integrity: sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==}
- resolution: {integrity: sha512-PdlvPnvIp4E1sYi46Ik4tBYh/v/NbYfFFgTjkwFl0is8A18s7/bx9aXqsrOax9WUbeNS6mD2oix7Z0yGGf6m5g==}
-
resolution: {integrity: sha512-x+j7kd5nDJCfbU53uwsMfXD7ALPu5uv0bqjAMQ5nVvXRoj1L7gkmswKtM3XDWYo4YUHf1jznlhSdPyy0xEwU+Q==}
peerDependencies:
@@ -14395,7 +14386,7 @@ snapshots:
dependencies:
crypto-js: 4.2.0
optionalDependencies:
react: 19.1.0
@@ -15210,12 +15201,6 @@ snapshots:
dependencies:
cross-spawn: 7.0.6
- dependencies:
- node-fetch: 2.7.0
- transitivePeerDependencies:
- - encoding
-
dependencies:
path-key: 3.1.1
@@ -16419,12 +16404,6 @@ snapshots:
- dependencies:
- cross-fetch: 4.0.0
- transitivePeerDependencies:
- - encoding
-
dependencies:
intl-messageformat: 10.7.16
@@ -17671,7 +17650,7 @@ snapshots:
react: 19.1.0
react-dom: 19.1.0([email protected])
dependencies:
react: 19.1.0