mirror of
https://github.com/mue/mue.git
synced 2026-07-25 09:47:26 +02:00
feat(translation): implement reactive translation system with context and hooks
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user