mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(locale): Added a locale setting in Settings app
This removes the need to rebuild the phone in order to change language
This commit is contained in:
1 parent
5c6538b340
commit
a6e8c769c0
6 files changed
+82
-9
No files matched your search
+9
-2
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import './Phone.css';
|
||||
import './i18n';
|
||||
import { Route } from 'react-router-dom';
|
||||
@@ -33,11 +33,18 @@ import { usePhone } from './os/phone/hooks/usePhone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
function Phone() {
|
||||
const { t } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { apps } = useApps();
|
||||
|
||||
const [settings] = useSettings();
|
||||
|
||||
// Set language from local storage
|
||||
// This will only trigger on first mount & settings changes
|
||||
useEffect(() => {
|
||||
i18n.changeLanguage(settings.language.value).catch((e) => console.error(e));
|
||||
}, [i18n, settings.language]);
|
||||
|
||||
useNuiService();
|
||||
useKeyboardService();
|
||||
usePhoneService();
|
||||
|
||||
Reference in new issue
Block a user