mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-09-14 13:56:46 +08:00
首次打开程序将根据计算机语言显示 Dawn Launcher 语言。
This commit is contained in:
parent
b9ac69cf22
commit
7ec78fef08
@ -1,6 +1,7 @@
|
|||||||
import { Setting } from "../../../types/setting";
|
import { Setting } from "../../../types/setting";
|
||||||
import { getSetting } from "../../../commons/utils/setting";
|
import { getSetting } from "../../../commons/utils/setting";
|
||||||
import { getDataSqlite3 } from "../../commons/betterSqlite3";
|
import { getDataSqlite3 } from "../../commons/betterSqlite3";
|
||||||
|
import { app } from "electron";
|
||||||
|
|
||||||
// 获取数据库
|
// 获取数据库
|
||||||
let db = getDataSqlite3();
|
let db = getDataSqlite3();
|
||||||
@ -50,6 +51,14 @@ function select() {
|
|||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
function add(setting: Setting) {
|
function add(setting: Setting) {
|
||||||
|
// 首次添加,判断系统语言
|
||||||
|
if (app.getLocale().toLowerCase().indexOf("zh-") === 0) {
|
||||||
|
// 简体中文
|
||||||
|
setting.general.language = "SimplifiedChinese";
|
||||||
|
} else {
|
||||||
|
// 英文
|
||||||
|
setting.general.language = "English";
|
||||||
|
}
|
||||||
// SQL
|
// SQL
|
||||||
let sql = `INSERT INTO ${settingTableName}
|
let sql = `INSERT INTO ${settingTableName}
|
||||||
(id, setting)
|
(id, setting)
|
||||||
|
Loading…
Reference in New Issue
Block a user