Add: detecting languages[de/cs/bg]

This commit is contained in:
Cutls 2019-08-07 23:14:20 +09:00
parent fed1496e68
commit 95f5ce13ba

View File

@ -94,13 +94,19 @@ app.on('activate', function () {
});
function createWindow() {
if (isFile(lang_path)) {1
if (isFile(lang_path)) {
var lang = fs.readFileSync(lang_path, 'utf8');
} else {
var langs = app.getLocale();
console.log(langs);
if (~langs.indexOf("ja")) {
lang = "ja";
} else if (~langs.indexOf("de")) {
lang = "de";
} else if (~langs.indexOf("cs")) {
lang = "cs";
} else if (~langs.indexOf("bg")) {
lang = "bg";
} else {
lang = "en";
}