From 4354ee7ba1c6ac9a9567944ae6169b1664e0ea8a Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 17 Nov 2024 00:33:28 +0000 Subject: feature: Add i18n support. Fixes #57 (#635) * feature(web): Add basic scaffolding for i18n * refactor: Switch most of the app's strings to use i18n strings * fix: Remove unused i18next-resources-for-ts command * Add user setting * More translations * Drop the german translation for now --- apps/web/lib/i18n/settings.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 apps/web/lib/i18n/settings.ts (limited to 'apps/web/lib/i18n/settings.ts') diff --git a/apps/web/lib/i18n/settings.ts b/apps/web/lib/i18n/settings.ts new file mode 100644 index 00000000..5787a55e --- /dev/null +++ b/apps/web/lib/i18n/settings.ts @@ -0,0 +1,17 @@ +import { supportedLangs } from "@hoarder/shared/langs"; + +export const fallbackLng = "en"; +export const languages = supportedLangs; +export const defaultNS = "translation"; +export const cookieName = "i18next"; + +export function getOptions(lng: string = fallbackLng, ns: string = defaultNS) { + return { + supportedLngs: languages, + fallbackLng, + lng, + fallbackNS: defaultNS, + defaultNS, + ns, + }; +} -- cgit v1.2.3-70-g09d2