Merge branch 'main' into main

This commit is contained in:
AISER
2025-10-10 23:30:52 +08:00
committed by GitHub
67 changed files with 2821 additions and 583 deletions
+14 -4
View File
@@ -54,6 +54,9 @@ Singleton {
var data = JSON.parse(text())
root.translations = data
Logger.log("I18n", `Loaded translations for "${root.langCode}"`)
if (debug) {
Logger.log("I18n", `Available root keys: ${Object.keys(data).join(", ")}`)
}
root.isLoaded = true
root.translationsLoaded()
@@ -279,9 +282,9 @@ Singleton {
interpolations = {}
if (!isLoaded) {
// if (debug) {
// Logger.warn("I18n", "Translations not loaded yet")
// }
if (debug) {
Logger.warn("I18n", "Translations not loaded yet")
}
return key
}
@@ -291,12 +294,19 @@ Singleton {
// Look-up translation in the active language
var value = translations
var notFound = false
if (debug) {
Logger.log("I18n", `Looking up key: "${key}"`)
}
for (var i = 0; i < keys.length; i++) {
if (value && typeof value === "object" && keys[i] in value) {
value = value[keys[i]]
if (debug) {
Logger.log("I18n", `Found key part "${keys[i]}"`)
}
} else {
if (debug) {
Logger.warn("I18n", `Translation key "${key}" not found`)
Logger.warn("I18n", `Translation key "${key}" not found at part "${keys[i]}"`)
Logger.warn("I18n", `Available keys: ${Object.keys(value || {}).join(", ")}`)
}
notFound = true
break
+37 -10
View File
@@ -33,6 +33,7 @@ Singleton {
// Signal emitted when settings are loaded after startupcale changes
signal settingsLoaded
signal settingsSaved
// -----------------------------------------------------
// -----------------------------------------------------
@@ -71,11 +72,7 @@ Singleton {
running: false
interval: 1000
onTriggered: {
settingsFileView.writeAdapter()
// Write to fallback location if set
if (Quickshell.env("NOCTALIA_SETTINGS_FALLBACK")) {
settingsFallbackFileView.writeAdapter()
}
root.saveImmediate()
}
}
@@ -162,10 +159,6 @@ Singleton {
"id": "Tray"
}, {
"id": "NotificationHistory"
}, {
"id": "WiFi"
}, {
"id": "Bluetooth"
}, {
"id": "Battery"
}, {
@@ -246,6 +239,23 @@ Singleton {
property JsonObject controlCenter: JsonObject {
// Position: close_to_bar_button, center, top_left, top_right, bottom_left, bottom_right, bottom_center, top_center
property string position: "close_to_bar_button"
property string quickSettingsStyle: "compact" // "compact", "classic", or "modern"
property JsonObject widgets
widgets: JsonObject {
property list<var> quickSettings: [{
"id": "WiFi"
}, {
"id": "Bluetooth"
}, {
"id": "Notifications"
}, {
"id": "ScreenRecorder"
}, {
"id": "PowerProfile"
}, {
"id": "WallpaperSelector"
}]
}
}
// dock
@@ -328,7 +338,13 @@ Singleton {
property bool ghostty: false
property bool foot: false
property bool fuzzel: false
property bool vesktop: false
property bool discord: false
property bool discord_vesktop: false
property bool discord_webcord: false
property bool discord_armcord: false
property bool discord_equibop: false
property bool discord_lightcord: false
property bool discord_dorion: false
property bool pywalfox: false
property bool enableUserTemplates: false
}
@@ -352,6 +368,17 @@ Singleton {
}
}
// -----------------------------------------------------
// Public function to trigger immediate settings saving
function saveImmediate() {
settingsFileView.writeAdapter()
// Write to fallback location if set
if (Quickshell.env("NOCTALIA_SETTINGS_FALLBACK")) {
settingsFallbackFileView.writeAdapter()
}
root.settingsSaved() // Emit signal after saving
}
// -----------------------------------------------------
// Generate default settings at the root of the repo
function generateDefaultSettings() {