mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
i18n-ja: add polling translation
This commit is contained in:
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Dunkler Modus",
|
||||
"light-mode": "Heller Modus",
|
||||
"enabled": "Aktiviert"
|
||||
"enabled": "Aktiviert",
|
||||
"light-mode": "Heller Modus"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'Nicht stören' deaktiviert",
|
||||
|
||||
@@ -2082,8 +2082,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Dark Mode",
|
||||
"light-mode": "Light Mode",
|
||||
"enabled": "Enabled"
|
||||
"enabled": "Enabled",
|
||||
"light-mode": "Light Mode"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "Do Not Disturb disabled",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Modo oscuro",
|
||||
"light-mode": "Modo claro",
|
||||
"enabled": "Activado"
|
||||
"enabled": "Activado",
|
||||
"light-mode": "Modo claro"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'No molestar' desactivado",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Mode sombre",
|
||||
"light-mode": "Mode clair",
|
||||
"enabled": "Activé"
|
||||
"enabled": "Activé",
|
||||
"light-mode": "Mode clair"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'Ne pas déranger' désactivé",
|
||||
|
||||
+1260
-1
File diff suppressed because it is too large
Load Diff
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Donkere modus",
|
||||
"light-mode": "Lichte modus",
|
||||
"enabled": "Ingeschakeld"
|
||||
"enabled": "Ingeschakeld",
|
||||
"light-mode": "Lichte modus"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "\"Niet storen\" uitgeschakeld",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Modo escuro",
|
||||
"light-mode": "Modo claro",
|
||||
"enabled": "Ativado"
|
||||
"enabled": "Ativado",
|
||||
"light-mode": "Modo claro"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'Não perturbe' desativado",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Тёмный режим",
|
||||
"light-mode": "Светлый режим",
|
||||
"enabled": "Включен"
|
||||
"enabled": "Включен",
|
||||
"light-mode": "Светлый режим"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "Режим 'Не беспокоить' отключен",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Karanlık mod",
|
||||
"light-mode": "Aydınlık mod",
|
||||
"enabled": "Etkin"
|
||||
"enabled": "Etkin",
|
||||
"light-mode": "Aydınlık mod"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'Rahatsız etme' devre dışı",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "Темний режим",
|
||||
"light-mode": "Світлий режим",
|
||||
"enabled": "Увімкнено"
|
||||
"enabled": "Увімкнено",
|
||||
"light-mode": "Світлий режим"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'Не турбувати' вимкнено",
|
||||
|
||||
@@ -2076,8 +2076,8 @@
|
||||
},
|
||||
"dark-mode": {
|
||||
"dark-mode": "深色模式",
|
||||
"light-mode": "浅色模式",
|
||||
"enabled": "已启用"
|
||||
"enabled": "已启用",
|
||||
"light-mode": "浅色模式"
|
||||
},
|
||||
"do-not-disturb": {
|
||||
"disabled": "'勿扰模式'已禁用",
|
||||
|
||||
@@ -14,6 +14,7 @@ RowLayout {
|
||||
NBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: root.shortcutsHeight
|
||||
visible: Settings.data.controlCenter.shortcuts.left.length > 0
|
||||
|
||||
RowLayout {
|
||||
id: leftContent
|
||||
@@ -53,6 +54,7 @@ RowLayout {
|
||||
NBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: root.shortcutsHeight
|
||||
visible: Settings.data.controlCenter.shortcuts.right.length > 0
|
||||
|
||||
RowLayout {
|
||||
id: rightContent
|
||||
|
||||
@@ -249,7 +249,7 @@ ColumnLayout {
|
||||
sectionName: I18n.tr("settings.control-center.shortcuts.sectionLeft")
|
||||
sectionId: "left"
|
||||
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml")
|
||||
maxWidgets: 5
|
||||
maxWidgets: Settings.data.controlCenter.shortcuts["right"].length > 5 ? 0 : (Settings.data.controlCenter.shortcuts["right"].length > 0 ? 5 : 10)
|
||||
widgetRegistry: ControlCenterWidgetRegistry
|
||||
widgetModel: Settings.data.controlCenter.shortcuts["left"]
|
||||
availableWidgets: availableWidgets
|
||||
@@ -266,7 +266,7 @@ ColumnLayout {
|
||||
sectionName: I18n.tr("settings.control-center.shortcuts.sectionRight")
|
||||
sectionId: "right"
|
||||
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/ControlCenter/ControlCenterWidgetSettingsDialog.qml")
|
||||
maxWidgets: 5
|
||||
maxWidgets: Settings.data.controlCenter.shortcuts["left"].length > 5 ? 0 : (Settings.data.controlCenter.shortcuts["left"].length > 0 ? 5 : 10)
|
||||
widgetRegistry: ControlCenterWidgetRegistry
|
||||
widgetModel: Settings.data.controlCenter.shortcuts["right"]
|
||||
availableWidgets: availableWidgets
|
||||
|
||||
+110
-112
@@ -27,155 +27,153 @@ Item {
|
||||
|
||||
// Initialization
|
||||
function initialize() {
|
||||
niriEventStream.running = true;
|
||||
niriEventStream.connected = true;
|
||||
niriCommandSocket.connected = true;
|
||||
|
||||
startEventStream();
|
||||
updateWorkspaces();
|
||||
updateWindows();
|
||||
queryDisplayScales();
|
||||
Logger.i("NiriService", "Service started");
|
||||
}
|
||||
|
||||
// command from https://yalter.github.io/niri/niri_ipc/enum.Request.html
|
||||
function sendSocketCommand(sock, command) {
|
||||
sock.write(JSON.stringify(command) + "\n");
|
||||
sock.flush();
|
||||
}
|
||||
|
||||
function startEventStream() {
|
||||
sendSocketCommand(niriEventStream, "EventStream");
|
||||
}
|
||||
|
||||
// Update workspaces
|
||||
function updateWorkspaces() {
|
||||
niriWorkspaceProcess.running = true;
|
||||
sendSocketCommand(niriCommandSocket, "Workspaces");
|
||||
}
|
||||
|
||||
// Update windows
|
||||
function updateWindows() {
|
||||
niriWindowsProcess.running = true;
|
||||
sendSocketCommand(niriCommandSocket, "Windows");
|
||||
}
|
||||
|
||||
// Query display scales
|
||||
function queryDisplayScales() {
|
||||
niriOutputsProcess.running = true;
|
||||
sendSocketCommand(niriCommandSocket, "Outputs");
|
||||
}
|
||||
|
||||
// Niri outputs process for display scale detection
|
||||
Process {
|
||||
id: niriOutputsProcess
|
||||
running: false
|
||||
command: ["niri", "msg", "--json", "outputs"]
|
||||
function recollectOutputs(outputsData) {
|
||||
const scales = {};
|
||||
|
||||
stdout: SplitParser {
|
||||
// Niri returns an object with display names as keys
|
||||
for (const outputName in outputsData) {
|
||||
const output = outputsData[outputName];
|
||||
if (output && output.name) {
|
||||
const logical = output.logical || {};
|
||||
const currentModeIdx = output.current_mode || 0;
|
||||
const modes = output.modes || [];
|
||||
const currentMode = modes[currentModeIdx] || {};
|
||||
|
||||
scales[output.name] = {
|
||||
"name": output.name,
|
||||
"scale": logical.scale || 1.0,
|
||||
"width": logical.width || 0,
|
||||
"height": logical.height || 0,
|
||||
"x": logical.x || 0,
|
||||
"y": logical.y || 0,
|
||||
"physical_width": (output.physical_size && output.physical_size[0]) || 0,
|
||||
"physical_height": (output.physical_size && output.physical_size[1]) || 0,
|
||||
"refresh_rate": currentMode.refresh_rate || 0,
|
||||
"vrr_supported": output.vrr_supported || false,
|
||||
"vrr_enabled": output.vrr_enabled || false,
|
||||
"transform": logical.transform || "Normal"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Notify CompositorService (it will emit displayScalesChanged)
|
||||
if (CompositorService && CompositorService.onDisplayScalesUpdated) {
|
||||
CompositorService.onDisplayScalesUpdated(scales);
|
||||
}
|
||||
}
|
||||
|
||||
function recollectWorkspaces(workspacesData) {
|
||||
const workspacesList = [];
|
||||
|
||||
for (const ws of workspacesData) {
|
||||
workspacesList.push({
|
||||
"id": ws.id,
|
||||
"idx": ws.idx,
|
||||
"name": ws.name || "",
|
||||
"output": ws.output || "",
|
||||
"isFocused": ws.is_focused === true,
|
||||
"isActive": ws.is_active === true,
|
||||
"isUrgent": ws.is_urgent === true,
|
||||
"isOccupied": ws.active_window_id ? true : false
|
||||
});
|
||||
}
|
||||
|
||||
// Sort workspaces by output, then by index
|
||||
workspacesList.sort((a, b) => {
|
||||
if (a.output !== b.output) {
|
||||
return a.output.localeCompare(b.output);
|
||||
}
|
||||
return a.idx - b.idx;
|
||||
});
|
||||
|
||||
// Update the workspaces ListModel
|
||||
workspaces.clear();
|
||||
for (var i = 0; i < workspacesList.length; i++) {
|
||||
workspaces.append(workspacesList[i]);
|
||||
}
|
||||
|
||||
workspaceChanged();
|
||||
}
|
||||
|
||||
// Niri command socket
|
||||
Socket {
|
||||
id: niriCommandSocket
|
||||
path: Quickshell.env("NIRI_SOCKET")
|
||||
connected: false
|
||||
|
||||
parser: SplitParser {
|
||||
onRead: function (line) {
|
||||
try {
|
||||
const outputsData = JSON.parse(line);
|
||||
const scales = {};
|
||||
const data = JSON.parse(line);
|
||||
|
||||
// Niri returns an object with display names as keys
|
||||
for (const outputName in outputsData) {
|
||||
const output = outputsData[outputName];
|
||||
if (output && output.name) {
|
||||
const logical = output.logical || {};
|
||||
const currentModeIdx = output.current_mode || 0;
|
||||
const modes = output.modes || [];
|
||||
const currentMode = modes[currentModeIdx] || {};
|
||||
|
||||
scales[output.name] = {
|
||||
"name": output.name,
|
||||
"scale": logical.scale || 1.0,
|
||||
"width": logical.width || 0,
|
||||
"height": logical.height || 0,
|
||||
"x": logical.x || 0,
|
||||
"y": logical.y || 0,
|
||||
"physical_width": (output.physical_size && output.physical_size[0]) || 0,
|
||||
"physical_height": (output.physical_size && output.physical_size[1]) || 0,
|
||||
"refresh_rate": currentMode.refresh_rate || 0,
|
||||
"vrr_supported": output.vrr_supported || false,
|
||||
"vrr_enabled": output.vrr_enabled || false,
|
||||
"transform": logical.transform || "Normal"
|
||||
};
|
||||
if (data && data.Ok) {
|
||||
const res = data.Ok;
|
||||
if (res.Windows) {
|
||||
recollectWindows(res.Windows);
|
||||
} else if (res.Outputs) {
|
||||
recollectOutputs(res.Outputs);
|
||||
} else if (res.Workspaces) {
|
||||
recollectWorkspaces(res.Workspaces);
|
||||
}
|
||||
}
|
||||
|
||||
// Notify CompositorService (it will emit displayScalesChanged)
|
||||
if (CompositorService && CompositorService.onDisplayScalesUpdated) {
|
||||
CompositorService.onDisplayScalesUpdated(scales);
|
||||
} else {
|
||||
Logger.e("NiriService", "Niri returned an error:", data.Err, line);
|
||||
}
|
||||
} catch (e) {
|
||||
Logger.e("NiriService", "Failed to parse outputs:", e, line);
|
||||
Logger.e("NiriService", "Failed to parse data from socket:", e, line);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Niri workspace process
|
||||
Process {
|
||||
id: niriWorkspaceProcess
|
||||
running: false
|
||||
command: ["niri", "msg", "--json", "workspaces"]
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: function (line) {
|
||||
try {
|
||||
const workspacesData = JSON.parse(line);
|
||||
const workspacesList = [];
|
||||
|
||||
for (const ws of workspacesData) {
|
||||
workspacesList.push({
|
||||
"id": ws.id,
|
||||
"idx": ws.idx,
|
||||
"name": ws.name || "",
|
||||
"output": ws.output || "",
|
||||
"isFocused": ws.is_focused === true,
|
||||
"isActive": ws.is_active === true,
|
||||
"isUrgent": ws.is_urgent === true,
|
||||
"isOccupied": ws.active_window_id ? true : false
|
||||
});
|
||||
}
|
||||
|
||||
// Sort workspaces by output, then by index
|
||||
workspacesList.sort((a, b) => {
|
||||
if (a.output !== b.output) {
|
||||
return a.output.localeCompare(b.output);
|
||||
}
|
||||
return a.idx - b.idx;
|
||||
});
|
||||
|
||||
// Update the workspaces ListModel
|
||||
workspaces.clear();
|
||||
for (var i = 0; i < workspacesList.length; i++) {
|
||||
workspaces.append(workspacesList[i]);
|
||||
}
|
||||
|
||||
workspaceChanged();
|
||||
} catch (e) {
|
||||
Logger.e("NiriService", "Failed to parse workspaces:", e, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Niri windows process
|
||||
Process {
|
||||
id: niriWindowsProcess
|
||||
running: false
|
||||
command: ["niri", "msg", "--json", "windows"]
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: function (line) {
|
||||
try {
|
||||
const windowsData = JSON.parse(line);
|
||||
recollectWindows(windowsData);
|
||||
} catch (e) {
|
||||
Logger.e("NiriService", "Failed to parse windows:", e, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Niri event stream process
|
||||
Process {
|
||||
// Niri event stream socket
|
||||
Socket {
|
||||
id: niriEventStream
|
||||
running: false
|
||||
command: ["niri", "msg", "--json", "event-stream"]
|
||||
path: Quickshell.env("NIRI_SOCKET")
|
||||
connected: false
|
||||
|
||||
stdout: SplitParser {
|
||||
parser: SplitParser {
|
||||
onRead: data => {
|
||||
try {
|
||||
const event = JSON.parse(data.trim());
|
||||
|
||||
if (event.WorkspacesChanged) {
|
||||
updateWorkspaces();
|
||||
recollectWorkspaces(event.WorkspacesChanged.workspaces);
|
||||
} else if (event.WindowOpenedOrChanged) {
|
||||
handleWindowOpenedOrChanged(event.WindowOpenedOrChanged);
|
||||
} else if (event.WindowClosed) {
|
||||
|
||||
@@ -620,43 +620,6 @@ Popup {
|
||||
columnSpacing: 6
|
||||
rowSpacing: 6
|
||||
|
||||
Repeater {
|
||||
model: ColorList.colors
|
||||
|
||||
Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
radius: Style.radiusXXS
|
||||
color: modelData.color
|
||||
border.color: root.selectedColor.toString() === modelData.color.toString() ? Color.mPrimary : Color.mOutline
|
||||
border.width: Math.max(1, root.selectedColor.toString() === modelData.color.toString() ? Style.borderM : Style.borderS)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered: {
|
||||
TooltipService.show(parent, modelData.name + "\n" + parent.color.toString().toUpperCase());
|
||||
}
|
||||
onExited: {
|
||||
TooltipService.hide();
|
||||
}
|
||||
onClicked: {
|
||||
root.selectedColor = modelData.color;
|
||||
TooltipService.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.columnSpan: 15
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXS
|
||||
Layout.bottomMargin: 0
|
||||
}
|
||||
|
||||
NLabel {
|
||||
Layout.columnSpan: 15
|
||||
Layout.fillWidth: true
|
||||
@@ -695,6 +658,43 @@ Popup {
|
||||
}
|
||||
]
|
||||
|
||||
Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
radius: Style.radiusXXS
|
||||
color: modelData.color
|
||||
border.color: root.selectedColor.toString() === modelData.color.toString() ? Color.mPrimary : Color.mOutline
|
||||
border.width: Math.max(1, root.selectedColor.toString() === modelData.color.toString() ? Style.borderM : Style.borderS)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered: {
|
||||
TooltipService.show(parent, modelData.name + "\n" + parent.color.toString().toUpperCase());
|
||||
}
|
||||
onExited: {
|
||||
TooltipService.hide();
|
||||
}
|
||||
onClicked: {
|
||||
root.selectedColor = modelData.color;
|
||||
TooltipService.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.columnSpan: 15
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXS
|
||||
Layout.bottomMargin: 0
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: ColorList.colors
|
||||
|
||||
Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
@@ -728,8 +728,8 @@ Popup {
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
//Layout.topMargin: 20
|
||||
//Layout.bottomMargin: 20
|
||||
Layout.topMargin: 1
|
||||
Layout.bottomMargin: 1
|
||||
spacing: 10
|
||||
|
||||
Item {
|
||||
|
||||
@@ -19,7 +19,7 @@ NBox {
|
||||
property string settingsDialogComponent: "BarWidgetSettingsDialog.qml"
|
||||
|
||||
readonly property real miniButtonSize: Style.baseWidgetSize * 0.65
|
||||
readonly property bool isAtMaxCapacity: maxWidgets > 0 && widgetModel.length >= maxWidgets
|
||||
readonly property bool isAtMaxCapacity: maxWidgets >= 0 && widgetModel.length >= maxWidgets
|
||||
|
||||
signal addWidget(string widgetId, string section)
|
||||
signal removeWidget(string section, int index)
|
||||
@@ -93,8 +93,8 @@ NBox {
|
||||
|
||||
// Widget count indicator (when max is set)
|
||||
NText {
|
||||
visible: root.maxWidgets > 0
|
||||
text: "(" + widgetModel.length + "/" + root.maxWidgets + ")"
|
||||
visible: root.maxWidgets >= 0
|
||||
text: root.maxWidgets === 0 ? "(LOCKED)" : "(" + widgetModel.length + "/" + root.maxWidgets + ")"
|
||||
pointSize: Style.fontSizeS
|
||||
color: root.isAtMaxCapacity ? Color.mError : Color.mOnSurfaceVariant
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
Reference in New Issue
Block a user