mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
@@ -1,5 +1,6 @@
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Qt.labs.folderlistmodel
|
||||
import Quickshell
|
||||
@@ -24,7 +25,9 @@ Singleton {
|
||||
readonly property url translationsFolder: Qt.resolvedUrl("../translations/poexports")
|
||||
|
||||
readonly property alias folder: dir.folder
|
||||
property var presentLocales: ({ "en": Qt.locale("en") })
|
||||
property var presentLocales: ({
|
||||
"en": Qt.locale("en")
|
||||
})
|
||||
property var translations: ({})
|
||||
property bool translationsLoaded: false
|
||||
|
||||
@@ -65,7 +68,9 @@ Singleton {
|
||||
}
|
||||
|
||||
function locale() {
|
||||
return presentLocales[_resolvedLocale] ?? presentLocales["en"];
|
||||
if (SessionData.timeLocale)
|
||||
return Qt.locale(SessionData.timeLocale);
|
||||
return Qt.locale();
|
||||
}
|
||||
|
||||
function _loadPresentLocales() {
|
||||
@@ -84,7 +89,8 @@ Singleton {
|
||||
function _pickTranslation() {
|
||||
for (let i = 0; i < _candidates.length; i++) {
|
||||
const cand = _candidates[i];
|
||||
if (presentLocales[cand] === undefined) continue;
|
||||
if (presentLocales[cand] === undefined)
|
||||
continue;
|
||||
_resolvedLocale = cand;
|
||||
useLocale(cand, cand.startsWith("en") ? "" : translationsFolder + "/" + cand + ".json");
|
||||
return;
|
||||
|
||||
@@ -129,6 +129,7 @@ Singleton {
|
||||
property var hiddenInputDeviceNames: []
|
||||
|
||||
property string locale: ""
|
||||
property string timeLocale: ""
|
||||
|
||||
property string launcherLastMode: "all"
|
||||
property string appDrawerLastMode: "apps"
|
||||
|
||||
@@ -80,6 +80,7 @@ var SPEC = {
|
||||
hiddenInputDeviceNames: { def: [] },
|
||||
|
||||
locale: { def: "", onChange: "updateLocale" },
|
||||
timeLocale: { def: "" },
|
||||
|
||||
launcherLastMode: { def: "all" },
|
||||
appDrawerLastMode: { def: "apps" },
|
||||
|
||||
Reference in New Issue
Block a user