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() { function createWindow() {
if (isFile(lang_path)) {1 if (isFile(lang_path)) {
var lang = fs.readFileSync(lang_path, 'utf8'); var lang = fs.readFileSync(lang_path, 'utf8');
} else { } else {
var langs = app.getLocale(); var langs = app.getLocale();
console.log(langs); console.log(langs);
if (~langs.indexOf("ja")) { if (~langs.indexOf("ja")) {
lang = "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 { } else {
lang = "en"; lang = "en";
} }