Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Fix language selection (#726)

BMa7dc067dfe08
diff --git a/src/appState.ts b/src/appState.ts
index f28e15ddeb..3ca929ead5 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 f330ca764a..fc67ac338e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1820,7 +1820,7 @@ export class App extends React.Component<any, AppState> {
<LanguageList
onChange={lng => {
setLanguage(lng);
- this.setState({});
+ this.setState({ lng });
}}
languages={languages}
currentLanguage={getLanguage()}
diff --git a/src/types.ts b/src/types.ts
index 0fee4633fe..e570ec5c41 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -27,4 +27,5 @@ export type AppState = {
name: string;
selectedId?: string;
isResizing: boolean;
+ lng: string;
};