Upgrade electron

This commit is contained in:
AlphaX-Projects
2023-09-15 13:54:59 +02:00
parent e52f7536f1
commit 3bf9fbd7d1
11 changed files with 304 additions and 312 deletions

View File

@@ -16,7 +16,7 @@ i18n.__ = function(name) {
let string = i18n.getLocaleData(cache.locale)[name] || i18n.getLocaleData(cache.defaultLocale)[name];
if (!string) {
let underscoreIndex = cache.locale.indexOf("_");
let underscoreIndex = cache.locale.indexOf("-");
if (underscoreIndex !== -1) {
let localeBaseCode = cache.locale.substring(0, underscoreIndex);
if (i18n.localeExists(localeBaseCode)) {
@@ -98,12 +98,12 @@ i18n.getLocale = function() {
let availableLocales = i18n.getAvailableLocales();
if (availableLocales.indexOf(systemLocale) !== -1) {
cache.locale = systemLocale;
} else if (availableLocales.indexOf(systemLocale.split("_")[0]) !== -1) {
cache.locale = systemLocale.split("_")[0];
} else if (availableLocales.indexOf(systemLocale.split("-")[0]) !== -1) {
cache.locale = systemLocale.split("-")[0];
} else {
var looseLocaleMatch;
for (let i = 0, l = availableLocales.length; i < l; i++) {
if (availableLocales[i].split("_")[0] === systemLocale.split("_")[0]) {
if (availableLocales[i].split("-")[0] === systemLocale.split("-")[0]) {
looseLocaleMatch = availableLocales[i];
break;
}