Fix language selection (#726)
This commit is contained in:
parent
3b20e6e2b8
commit
a7dc067dfe
@ -1,5 +1,6 @@
|
|||||||
import { AppState } from "./types";
|
import { AppState } from "./types";
|
||||||
import { getDateTime } from "./utils";
|
import { getDateTime } from "./utils";
|
||||||
|
import { getLanguage } from "./i18n";
|
||||||
|
|
||||||
const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
|
const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ export function getDefaultAppState(): AppState {
|
|||||||
name: DEFAULT_PROJECT_NAME,
|
name: DEFAULT_PROJECT_NAME,
|
||||||
isResizing: false,
|
isResizing: false,
|
||||||
selectionElement: null,
|
selectionElement: null,
|
||||||
|
lng: getLanguage(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1820,7 +1820,7 @@ export class App extends React.Component<any, AppState> {
|
|||||||
<LanguageList
|
<LanguageList
|
||||||
onChange={lng => {
|
onChange={lng => {
|
||||||
setLanguage(lng);
|
setLanguage(lng);
|
||||||
this.setState({});
|
this.setState({ lng });
|
||||||
}}
|
}}
|
||||||
languages={languages}
|
languages={languages}
|
||||||
currentLanguage={getLanguage()}
|
currentLanguage={getLanguage()}
|
||||||
|
@ -27,4 +27,5 @@ export type AppState = {
|
|||||||
name: string;
|
name: string;
|
||||||
selectedId?: string;
|
selectedId?: string;
|
||||||
isResizing: boolean;
|
isResizing: boolean;
|
||||||
|
lng: string;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user