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