diff --git a/src/appState.ts b/src/appState.ts index f28e15dd..3ca929ea 100644 --- a/src/appState.ts +++ b/src/appState.ts @@ -1,5 +1,6 @@ import { AppState } from "./types"; import { getDateTime } from "./utils"; +import { getLanguage } from "./i18n"; const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`; @@ -28,6 +29,7 @@ export function getDefaultAppState(): AppState { name: DEFAULT_PROJECT_NAME, isResizing: false, selectionElement: null, + lng: getLanguage(), }; } diff --git a/src/index.tsx b/src/index.tsx index f330ca76..fc67ac33 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1820,7 +1820,7 @@ export class App extends React.Component { { setLanguage(lng); - this.setState({}); + this.setState({ lng }); }} languages={languages} currentLanguage={getLanguage()} diff --git a/src/types.ts b/src/types.ts index 0fee4633..e570ec5c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -27,4 +27,5 @@ export type AppState = { name: string; selectedId?: string; isResizing: boolean; + lng: string; };