Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 69afadb

Browse files
fix localisation on cloud
1 parent 4e6e4cb commit 69afadb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

client/src/CloudApp.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ import { getConfig } from './services/api';
55
import App from './App';
66
import { LocaleContext } from './context/localeContext';
77
import i18n from './i18n';
8-
import { LANGUAGE_KEY, savePlainToStorage } from './services/storage';
8+
import {
9+
getPlainFromStorage,
10+
LANGUAGE_KEY,
11+
savePlainToStorage,
12+
} from './services/storage';
913

1014
const CloudApp = () => {
1115
const [envConfig, setEnvConfig] = useState({});
12-
const [locale, setLocale] = useState('en');
16+
const [locale, setLocale] = useState(
17+
getPlainFromStorage(LANGUAGE_KEY) || 'en',
18+
);
1319

1420
useEffect(() => {
1521
setTimeout(() => getConfig().then(setEnvConfig), 1000); // server returns wrong tracking_id within first second

0 commit comments

Comments
 (0)