feat(website/i18n): get translation to actually render

This commit is contained in:
Elian Doran
2025-10-25 19:13:28 +03:00
parent 49cf7ae1a3
commit e4f806ed14
10 changed files with 178 additions and 149 deletions

View File

@@ -8,6 +8,8 @@ import Footer from './components/Footer.js';
import GetStarted from './pages/GetStarted/get-started.js';
import SupportUs from './pages/SupportUs/SupportUs.js';
import { createContext } from 'preact';
import { useEffect } from 'preact/hooks';
import { changeLanguage } from 'i18next';
export const LocaleContext = createContext('en');
@@ -34,6 +36,10 @@ export function LocaleProvider({ children }) {
const { path } = useLocation();
const locale = path.split('/')[1] || 'en';
useEffect(() => {
changeLanguage(locale);
}, [ locale ]);
return (
<LocaleContext.Provider value={locale}>
{children}