feat(translation): implement reactive translation system with context and hooks

This commit is contained in:
alexsparkes
2026-01-24 17:02:41 +00:00
parent d0dbd7e75c
commit b8647538fd
13 changed files with 210 additions and 35 deletions

View File

@@ -6,6 +6,7 @@ import Modals from 'features/misc/modals/Modals';
import { loadSettings, moveSettings } from 'utils/settings';
import EventBus from 'utils/eventbus';
import variables from 'config/variables';
import { TranslationProvider } from 'contexts/TranslationContext';
const useAppSetup = () => {
useEffect(() => {
@@ -54,8 +55,10 @@ const App = () => {
useAppSetup();
const languagecode = localStorage.getItem('language') || 'en_GB';
return (
<>
<TranslationProvider initialLanguage={languagecode}>
{showBackground && <Background />}
<ToastContainer
position="top-center"
@@ -68,7 +71,7 @@ const App = () => {
<Widgets />
<Modals />
</div>
</>
</TranslationProvider>
);
};