mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 21:23:58 +01:00
i18n: html lang attribute
This commit is contained in:
parent
c06415d4fb
commit
0e08f8f46a
|
@ -1,5 +1,6 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import useStore from '@store/store';
|
import useStore from '@store/store';
|
||||||
|
import i18n from './i18n';
|
||||||
|
|
||||||
import Chat from '@components/Chat';
|
import Chat from '@components/Chat';
|
||||||
import Menu from '@components/Menu';
|
import Menu from '@components/Menu';
|
||||||
|
@ -16,6 +17,13 @@ function App() {
|
||||||
const setApiKey = useStore((state) => state.setApiKey);
|
const setApiKey = useStore((state) => state.setApiKey);
|
||||||
const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex);
|
const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.documentElement.lang = i18n.language;
|
||||||
|
i18n.on('languageChanged', (lng) => {
|
||||||
|
document.documentElement.lang = lng;
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// legacy local storage
|
// legacy local storage
|
||||||
const oldChats = localStorage.getItem('chats');
|
const oldChats = localStorage.getItem('chats');
|
||||||
|
|
Loading…
Reference in a new issue