Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
♻️ Remove http backend (#1962)
Luke Vella9ddc26146b2d
diff --git a/apps/web/package.json b/apps/web/package.jsonindex 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.tsxindex 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.tsindex 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.tsindex 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.yamlindex 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- version: 1.5.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 1.5.0([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])dayjs:specifier: ^1.11.13version: 1.11.13@@ -119,7 +119,7 @@ importers:next-seo:specifier: ^6.1.0- version: 6.6.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 6.6.0([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])react:specifier: ^19.1.0version: 19.1.0@@ -316,9 +316,6 @@ importers:i18next:specifier: ^24.2.2version: 24.2.3([email protected])- i18next-http-backend:- specifier: ^3.0.2- version: 3.0.2i18next-icu:specifier: ^2.3.0version: 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- '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':+ '@vercel/[email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':optionalDependencies:next: 15.4.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])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.0react-dom: 19.1.0([email protected])- [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ [email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):dependencies:next: 15.4.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 19.1.0