Skip to content

Commit

Permalink
Apply ko lang when ko lang in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongJun-Lee committed May 22, 2021
1 parent e9ed775 commit f5cc075
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const runtimeProperties: RuntimeGlobalProperties = {
roomIds: [],
file: commandLineOptions.file || '',
appName: 'entry',
language: app.getLocale()
language: ''
};

global.sharedObject = Object.assign({}, runtimeProperties, configurations, commandLineOptions);
Expand Down Expand Up @@ -45,6 +45,7 @@ if (!app.requestSingleInstanceLock()) {
mainWindow = new MainWindowManager(commandLineOptions);
const hardwareWindow = new HardwareWindowManager();
const aboutWindow = new AboutWindowManager(mainWindow.window);
global.sharedObject.language = app.getLocale();

app.on('second-instance', (event, commandLine, workingDirectory) => {
// 어플리케이션을 중복 실행했습니다. 주 어플리케이션 인스턴스를 활성화 합니다.
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class Header extends Component<IProps, IState> {
}

getLangValue() {
this.props.persist.lang = window.getSharedObject().language == 'uz' ? 'uz' : 'ko';
const lang = this.props.persist.lang;
return _get(Lang, lang);
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/helper/importToggleHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class {
*/
static async changeLang(lang: string) {
window.Lang = await import(`../resources/lang/${lang}.json`);
window.getSharedObject().language = window.Lang.type;
window.getSharedObject().language = lang;
window.initNativeMenu();
}
}
2 changes: 1 addition & 1 deletion src/renderer/initEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import StorageManager from './helper/storageManager';
import ImportToggleHelper from './helper/importToggleHelper';

// Lang, EntryStatic
const lastLang = StorageManager.getPersistLangType() || 'uz'; // 'ko'; // Changed for uz version
const lastLang = StorageManager.getPersistLangType() || (window.getSharedObject().language == 'ru' ? 'uz' : 'ko');
const lastWSMode = StorageManager.getPersistWorkspaceMode();

(async() => {
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/store/modules/persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export interface IPersistState {
}

const defaultState: IPersistState = {
// Changed for uz version
lang: 'uz', // 'ko',
lang: 'ko',
mode: 'workspace', // undefined,
};

Expand Down

0 comments on commit f5cc075

Please sign in to comment.