From 20af01f35c2c108f10438cb3678e86532d171849 Mon Sep 17 00:00:00 2001 From: tks-abe Date: Wed, 21 Feb 2018 12:00:08 +0900 Subject: [PATCH] #2 Fixed issue that failed to start if OS locale is other than English and Japanese. --- README.ja.md | 2 ++ README.md | 2 ++ package.json | 2 +- src/main/main.js | 9 ++++++--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index ffb2637..e162264 100644 --- a/README.ja.md +++ b/README.ja.md @@ -78,6 +78,8 @@ FlashAir™の無線LAN機能を使い、FlashAir IoT Hubを経由する事で ## Changelog +- [0.3.1](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.3.1) + - OSの言語設定が英語と日本語以外の場合、起動に失敗する問題を修正しました。 - [0.3.0](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.3.0) - 英語表示に対応しました。`メニュー > 言語`から言語を切り替え可能です。(日本語 / 英語) - [0.2.1](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.2.1) diff --git a/README.md b/README.md index d88eca2..034b130 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,8 @@ Note: Since version 0.2.0, Lua scripts are using [FlashAir IoT Hub](https://iot- ## Changelog +- [0.3.1](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.3.1) + - Fixed issue that failed to start if OS locale is other than English and Japanese. - [0.3.0](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.3.0) - Supported English display. You can switch display languages from `Menu> Language`. - [0.2.1](https://github.com/FlashAirDevelopers/FlashAirFileManager/releases/tag/v0.2.1) diff --git a/package.json b/package.json index 7364d7f..66a5ac0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flashair-file-manager", - "version": "0.3.0", + "version": "0.3.1", "description": "The application to browse and download files on FlashAir™ via the network.", "homepage": "https://github.com/FlashAirDevelopers/FlashAirFileManager", "main": "./src/main/main.js", diff --git a/src/main/main.js b/src/main/main.js index c34618f..9b42ca3 100644 --- a/src/main/main.js +++ b/src/main/main.js @@ -123,7 +123,7 @@ const changeLocale = newLocale => { log.error(error); } }); - const mainManue = getMainManue(newLocale); + const mainManue = getMainManue(locale); const menu = Menu.buildFromTemplate(mainManue); Menu.setApplicationMenu(menu); if (mainWindow !== null) { @@ -204,11 +204,14 @@ app.on('ready', () => { locale = data.locale; } } + // check supported language + if ((locale !== 'ja') && (locale !== 'en-US')) { + locale = 'en-US'; + } + createWindow(); // Create menu changeLocale(locale); }); - - createWindow(); }); app.on('did-finish-load', () => {