diff --git a/ModuleKit/Widgets/BarChart.swift b/ModuleKit/Widgets/BarChart.swift index 70608a21..d6078ef5 100644 --- a/ModuleKit/Widgets/BarChart.swift +++ b/ModuleKit/Widgets/BarChart.swift @@ -224,14 +224,14 @@ public class BarChart: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 3, width: view.frame.width, height: rowHeight), - title: "Label", + title: LocalizedString("Label"), action: #selector(toggleLabel), state: self.labelState )) self.boxSettingsView = ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 2, width: view.frame.width, height: rowHeight), - title: "Box", + title: LocalizedString("Box"), action: #selector(toggleBox), state: self.boxState ) @@ -239,7 +239,7 @@ public class BarChart: Widget { self.frameSettingsView = ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 1, width: view.frame.width, height: rowHeight), - title: "Frame", + title: LocalizedString("Frame"), action: #selector(toggleFrame), state: self.frameState ) @@ -247,7 +247,7 @@ public class BarChart: Widget { view.addSubview(SelectColorRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 0, width: view.frame.width, height: rowHeight), - title: "Color", + title: LocalizedString("Color"), action: #selector(toggleColor), items: self.colors.map{ $0.rawValue }, selected: self.colorState.rawValue diff --git a/ModuleKit/Widgets/Battery.swift b/ModuleKit/Widgets/Battery.swift index 3eeca4c9..bd60c915 100644 --- a/ModuleKit/Widgets/Battery.swift +++ b/ModuleKit/Widgets/Battery.swift @@ -205,7 +205,7 @@ public class BatterykWidget: Widget { view.addSubview(SelectTitleRow( frame: NSRect(x: 0, y: rowHeight + Constants.Settings.margin, width: view.frame.width, height: rowHeight), - title: "Additional information", + title: LocalizedString("Additional information"), action: #selector(toggleAdditional), items: battery_additional_t.allCases.map{ return $0.rawValue }, selected: self.additional.rawValue @@ -213,7 +213,7 @@ public class BatterykWidget: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 0, width: view.frame.width, height: rowHeight), - title: "Colorize", + title: LocalizedString("Colorize"), action: #selector(toggleColor), state: self.colorState )) diff --git a/ModuleKit/Widgets/LineChart.swift b/ModuleKit/Widgets/LineChart.swift index a1589537..dc548fe8 100644 --- a/ModuleKit/Widgets/LineChart.swift +++ b/ModuleKit/Widgets/LineChart.swift @@ -202,21 +202,21 @@ public class LineChart: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 5, width: view.frame.width, height: rowHeight), - title: "Label", + title: LocalizedString("Label"), action: #selector(toggleLabel), state: self.labelState )) view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 4, width: view.frame.width, height: rowHeight), - title: "Value", + title: LocalizedString("Value"), action: #selector(toggleValue), state: self.valueState )) self.boxSettingsView = ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 3, width: view.frame.width, height: rowHeight), - title: "Box", + title: LocalizedString("Box"), action: #selector(toggleBox), state: self.boxState ) @@ -224,7 +224,7 @@ public class LineChart: Widget { self.frameSettingsView = ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 2, width: view.frame.width, height: rowHeight), - title: "Frame", + title: LocalizedString("Frame"), action: #selector(toggleFrame), state: self.frameState ) @@ -232,7 +232,7 @@ public class LineChart: Widget { view.addSubview(SelectColorRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 1, width: view.frame.width, height: rowHeight), - title: "Color", + title: LocalizedString("Color"), action: #selector(toggleColor), items: self.colors.map{ $0.rawValue }, selected: self.colorState.rawValue @@ -240,7 +240,7 @@ public class LineChart: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 0, width: view.frame.width, height: rowHeight), - title: "Colorize value", + title: LocalizedString("Colorize value"), action: #selector(toggleValueColor), state: self.valueColorState )) diff --git a/ModuleKit/Widgets/Memory.swift b/ModuleKit/Widgets/Memory.swift index e488a362..937a6837 100644 --- a/ModuleKit/Widgets/Memory.swift +++ b/ModuleKit/Widgets/Memory.swift @@ -107,7 +107,7 @@ public class MemoryWidget: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 0, width: view.frame.width, height: rowHeight), - title: "Reverse values order", + title: LocalizedString("Reverse values order"), action: #selector(toggleOrder), state: self.orderReversedState )) diff --git a/ModuleKit/Widgets/Mini.swift b/ModuleKit/Widgets/Mini.swift index 6e17ed41..5c7c25c8 100644 --- a/ModuleKit/Widgets/Mini.swift +++ b/ModuleKit/Widgets/Mini.swift @@ -130,14 +130,14 @@ public class Mini: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: rowHeight + Constants.Settings.margin, width: view.frame.width, height: rowHeight), - title: "Label", + title: LocalizedString("Label"), action: #selector(toggleLabel), state: self.labelState )) view.addSubview(SelectColorRow( frame: NSRect(x: 0, y: (rowHeight + Constants.Settings.margin) * 0, width: view.frame.width, height: rowHeight), - title: "Color", + title: LocalizedString("Color"), action: #selector(toggleColor), items: self.colors.map{ $0.rawValue }, selected: self.colorState.rawValue diff --git a/ModuleKit/Widgets/Speed.swift b/ModuleKit/Widgets/Speed.swift index 46ca0c0c..085296e4 100644 --- a/ModuleKit/Widgets/Speed.swift +++ b/ModuleKit/Widgets/Speed.swift @@ -214,7 +214,7 @@ public class SpeedWidget: Widget { view.addSubview(SelectTitleRow( frame: NSRect(x: 0, y: rowHeight + Constants.Settings.margin, width: view.frame.width, height: rowHeight), - title: "Pictogram", + title: LocalizedString("Pictogram"), action: #selector(toggleIcon), items: speed_icon_t.allCases.map{ return $0.rawValue }, selected: self.icon.rawValue @@ -222,7 +222,7 @@ public class SpeedWidget: Widget { view.addSubview(ToggleTitleRow( frame: NSRect(x: 0, y: 0, width: view.frame.width, height: rowHeight), - title: "Value", + title: LocalizedString("Value"), action: #selector(toggleValue), state: self.valueState )) diff --git a/ModuleKit/popup.swift b/ModuleKit/popup.swift index 68a22fc4..b6f6ed86 100644 --- a/ModuleKit/popup.swift +++ b/ModuleKit/popup.swift @@ -188,6 +188,7 @@ internal class HeaderView: NSView { activity.isBordered = false activity.action = #selector(openActivityMonitor) activity.target = self + activity.toolTip = LocalizedString("Open Activity Monitor") let title = NSTextField(frame: NSMakeRect(frame.width/4, (frame.height - 18)/2, frame.width/2, 18)) title.isEditable = false @@ -213,6 +214,7 @@ internal class HeaderView: NSView { settings.isBordered = false settings.action = #selector(openMenu) settings.target = self + settings.toolTip = LocalizedString("Open module settings") self.addSubview(activity) self.addSubview(title) diff --git a/ModuleKit/settings.swift b/ModuleKit/settings.swift index 796ed916..4e684374 100644 --- a/ModuleKit/settings.swift +++ b/ModuleKit/settings.swift @@ -318,7 +318,7 @@ class WidgetPreview: NSView { self.layer?.borderColor = self.state ? NSColor.systemBlue.cgColor : NSColor(hexString: "#dddddd").cgColor self.layer?.borderWidth = 1 - self.toolTip = "Select \(widget.name) widget" + self.toolTip = LocalizedString("Select widget", widget.name) widget.widthHandler = { [weak self] value in self?.removeTrackingArea((self?.trackingAreas.first)!) diff --git a/Modules/Battery/main.swift b/Modules/Battery/main.swift index a65e2c90..2864212d 100644 --- a/Modules/Battery/main.swift +++ b/Modules/Battery/main.swift @@ -133,13 +133,13 @@ public class Battery: Module { } if value.level <= notificationLevel && self.notification == nil { - var subtitle = "\((Int(value.level*100)))% remaining" + var subtitle = LocalizedString("Battery remaining", "\(Int(value.level*100))") if value.timeToEmpty > 0 { subtitle += " (\(Double(value.timeToEmpty*60).printSecondsToHoursMinutesSeconds()))" } self.notification = showNotification( - title: "Low battery", + title: LocalizedString("Low battery"), subtitle: subtitle, id: "battery-level", icon: NSImage(named: NSImage.Name("low-battery"))! diff --git a/Modules/Battery/popup.swift b/Modules/Battery/popup.swift index 46c492fc..bf8b4ffa 100644 --- a/Modules/Battery/popup.swift +++ b/Modules/Battery/popup.swift @@ -74,17 +74,17 @@ internal class Popup: NSView { private func initDetails() { let y: CGFloat = self.dashboardView!.frame.origin.y - Constants.Popup.separatorHeight - let separator = SeparatorView("Details", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Details"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.detailsHeight, width: self.frame.width, height: self.detailsHeight)) - self.levelField = PopupRow(view, n: 3, title: "Level:", value: "") - self.sourceField = PopupRow(view, n: 2, title: "Source:", value: "") - let t = self.labelValue(view, n: 1, title: "Time:", value: "") + self.levelField = PopupRow(view, n: 3, title: "\(LocalizedString("Details"))Level:", value: "") + self.sourceField = PopupRow(view, n: 2, title: "\(LocalizedString("Source")):", value: "") + let t = self.labelValue(view, n: 1, title: "\(LocalizedString("Time")):", value: "") self.timeLabelField = t.0 self.timeField = t.1 - self.healthField = PopupRow(view, n: 0, title: "Health:", value: "") + self.healthField = PopupRow(view, n: 0, title: "\(LocalizedString("Health")):", value: "") self.addSubview(view) self.detailsView = view @@ -105,14 +105,14 @@ internal class Popup: NSView { private func initBattery() { let y: CGFloat = self.detailsView!.frame.origin.y - Constants.Popup.separatorHeight - let separator = SeparatorView("Battery", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Battery"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.batteryHeight, width: self.frame.width, height: self.batteryHeight)) - self.amperageField = PopupRow(view, n: 2, title: "Amperage:", value: "") - self.voltageField = PopupRow(view, n: 1, title: "Voltage:", value: "") - self.temperatureField = PopupRow(view, n: 0, title: "Temperature:", value: "") + self.amperageField = PopupRow(view, n: 2, title: "\(LocalizedString("Amperage")):", value: "") + self.voltageField = PopupRow(view, n: 1, title: "\(LocalizedString("Voltage")):", value: "") + self.temperatureField = PopupRow(view, n: 0, title: "\(LocalizedString("Temperature")):", value: "") self.addSubview(view) self.batteryView = view @@ -120,20 +120,20 @@ internal class Popup: NSView { private func initAdapter() { let y: CGFloat = self.batteryView!.frame.origin.y - Constants.Popup.separatorHeight - let separator = SeparatorView("Power adapter", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Power adapter"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.adapterHeight, width: self.frame.width, height: self.adapterHeight)) - self.powerField = PopupRow(view, n: 1, title: "Power:", value: "") - self.chargingStateField = PopupRow(view, n: 0, title: "Is charging:", value: "") + self.powerField = PopupRow(view, n: 1, title: "\(LocalizedString("Power")):", value: "") + self.chargingStateField = PopupRow(view, n: 0, title: "\(LocalizedString("Is charging")):", value: "") self.addSubview(view) self.adapterView = view } private func initProcesses() { - let separator = SeparatorView("Top processes", origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Top processes"), origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.processesHeight)) @@ -158,23 +158,23 @@ internal class Popup: NSView { self.timeField?.stringValue = "" if value.powerSource == "Battery Power" { - self.timeLabelField?.stringValue = "Time to discharge:" + self.timeLabelField?.stringValue = "\(LocalizedString("Time to discharge")):" if value.timeToEmpty != -1 && value.timeToEmpty != 0 { self.timeField?.stringValue = Double(value.timeToEmpty*60).printSecondsToHoursMinutesSeconds() } } else { - self.timeLabelField?.stringValue = "Time to charge:" + self.timeLabelField?.stringValue = "\(LocalizedString("Time to charge")):" if value.timeToCharge != -1 && value.timeToCharge != 0 { self.timeField?.stringValue = Double(value.timeToCharge*60).printSecondsToHoursMinutesSeconds() } } if value.timeToEmpty == -1 || value.timeToCharge == -1 { - self.timeField?.stringValue = "Calculating" + self.timeField?.stringValue = LocalizedString("Calculating") } if value.isCharged { - self.timeField?.stringValue = "Fully charged" + self.timeField?.stringValue = LocalizedString("Fully charged") } self.healthField?.stringValue = "\(value.health) % (\(value.state))" @@ -183,8 +183,8 @@ internal class Popup: NSView { self.voltageField?.stringValue = "\(value.voltage.roundTo(decimalPlaces: 2)) V" self.temperatureField?.stringValue = "\(value.temperature) °C" - self.powerField?.stringValue = value.powerSource == "Battery Power" ? "Not connected" : "\(value.ACwatts) W" - self.chargingStateField?.stringValue = value.isCharging ? "Yes" : "No" + self.powerField?.stringValue = value.powerSource == "Battery Power" ? LocalizedString("Not connected") : "\(value.ACwatts) W" + self.chargingStateField?.stringValue = value.isCharging ? LocalizedString("Yes") : LocalizedString("No") }) } diff --git a/Modules/Battery/settings.swift b/Modules/Battery/settings.swift index 5347adef..b51c2525 100644 --- a/Modules/Battery/settings.swift +++ b/Modules/Battery/settings.swift @@ -66,7 +66,7 @@ internal class Settings: NSView, Settings_v { width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight ), - title: "Low level notification", + title: LocalizedString("Low level notification"), action: #selector(changeUpdateInterval), items: levels, selected: self.lowLevelNotification == "Disabled" ? self.lowLevelNotification : "\(Int((Double(self.lowLevelNotification) ?? 0)*100))%" diff --git a/Modules/CPU/popup.swift b/Modules/CPU/popup.swift index b7add6ab..3ca66aa2 100644 --- a/Modules/CPU/popup.swift +++ b/Modules/CPU/popup.swift @@ -67,13 +67,13 @@ internal class Popup: NSView { let container: NSView = NSView(frame: NSRect(x: 0, y: 10, width: view.frame.width, height: self.dashboardHeight-20)) self.circle = CircleGraphView(frame: NSRect(x: (container.frame.width - container.frame.height)/2, y: 0, width: container.frame.height, height: container.frame.height), segments: []) - self.circle!.toolTip = "CPU usage" + self.circle!.toolTip = LocalizedString("CPU usage") container.addSubview(self.circle!) let centralWidth: CGFloat = self.dashboardHeight-20 let sideWidth: CGFloat = (view.frame.width - centralWidth - (Constants.Popup.margins*2))/2 self.temperatureCircle = HalfCircleGraphView(frame: NSRect(x: (sideWidth - 60)/2, y: 10, width: 60, height: 50)) - self.temperatureCircle!.toolTip = "CPU temperature" + self.temperatureCircle!.toolTip = LocalizedString("CPU temperature") view.addSubview(self.temperatureCircle!) view.addSubview(container) @@ -83,7 +83,7 @@ internal class Popup: NSView { private func initChart() { let y: CGFloat = self.frame.height - self.dashboardHeight - Constants.Popup.separatorHeight - let separator = SeparatorView("Usage history", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Usage history"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: y - self.chartHeight, width: self.frame.width, height: self.chartHeight)) @@ -100,20 +100,20 @@ internal class Popup: NSView { private func initDetails() { let y: CGFloat = self.frame.height - self.dashboardHeight - self.chartHeight - (Constants.Popup.separatorHeight*2) - let separator = SeparatorView("Details", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Details"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.detailsHeight, width: self.frame.width, height: self.detailsHeight)) - self.systemField = PopupWithColorRow(view, color: NSColor.systemRed, n: 2, title: "System:", value: "") - self.userField = PopupWithColorRow(view, color: NSColor.systemBlue, n: 1, title: "User:", value: "") - self.idleField = PopupWithColorRow(view, color: NSColor.lightGray.withAlphaComponent(0.5), n: 0, title: "Idle:", value: "") + self.systemField = PopupWithColorRow(view, color: NSColor.systemRed, n: 2, title: "\(LocalizedString("System")):", value: "") + self.userField = PopupWithColorRow(view, color: NSColor.systemBlue, n: 1, title: "\(LocalizedString("User")):", value: "") + self.idleField = PopupWithColorRow(view, color: NSColor.lightGray.withAlphaComponent(0.5), n: 0, title: "\(LocalizedString("Idle")):", value: "") self.addSubview(view) } private func initProcesses() { - let separator = SeparatorView("Top processes", origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Top processes"), origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.processesHeight)) diff --git a/Modules/CPU/settings.swift b/Modules/CPU/settings.swift index f2fd87fb..11b1bb00 100644 --- a/Modules/CPU/settings.swift +++ b/Modules/CPU/settings.swift @@ -60,7 +60,7 @@ internal class Settings: NSView, Settings_v { self.addSubview(SelectTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * num, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Update interval", + title: LocalizedString("Update interval"), action: #selector(changeUpdateInterval), items: self.listOfUpdateIntervals.map{ "\($0) sec" }, selected: "\(self.updateIntervalValue) sec" @@ -69,14 +69,14 @@ internal class Settings: NSView, Settings_v { if widget == .barChart { self.addSubview(ToggleTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * 1, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Show usage per core", + title: LocalizedString("Show usage per core"), action: #selector(toggleUsagePerCore), state: self.usagePerCoreState )) self.hyperthreadView = ToggleTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * 0, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Show hyper-threading cores", + title: LocalizedString("Show hyper-threading cores"), action: #selector(toggleMultithreading), state: self.hyperthreadState ) diff --git a/Modules/Disk/popup.swift b/Modules/Disk/popup.swift index 993d2340..d8a740da 100644 --- a/Modules/Disk/popup.swift +++ b/Modules/Disk/popup.swift @@ -157,7 +157,7 @@ internal class DiskView: NSView { self.legendField = TextView(frame: NSRect(x: 0, y: 0, width: view.frame.width - 40, height: view.frame.height)) self.legendField?.font = NSFont.systemFont(ofSize: 11, weight: .light) - self.legendField?.stringValue = "Used \(Units(bytes: (self.size - free)).getReadableMemory()) from \(Units(bytes: self.size).getReadableMemory())" + self.legendField?.stringValue = LocalizedString("Used disk memory", Units(bytes: (self.size - free)).getReadableMemory(), Units(bytes: self.size).getReadableMemory()) self.percentageField = TextView(frame: NSRect(x: view.frame.width - 40, y: 0, width: 40, height: view.frame.height)) self.percentageField?.font = NSFont.systemFont(ofSize: 11, weight: .regular) @@ -199,7 +199,7 @@ internal class DiskView: NSView { DispatchQueue.main.async(execute: { if (self.window?.isVisible ?? false) || !self.ready { if self.legendField != nil { - self.legendField?.stringValue = "Used \(Units(bytes: (self.size - free)).getReadableMemory()) from \(Units(bytes: self.size).getReadableMemory())" + self.legendField?.stringValue = LocalizedString("Used disk memory", Units(bytes: (self.size - free)).getReadableMemory(), Units(bytes: self.size).getReadableMemory()) self.percentageField?.stringValue = "\(Int8((Double(self.size - free) / Double(self.size)) * 100))%" } diff --git a/Modules/Disk/settings.swift b/Modules/Disk/settings.swift index d502c8f7..e9bacc51 100644 --- a/Modules/Disk/settings.swift +++ b/Modules/Disk/settings.swift @@ -58,7 +58,7 @@ internal class Settings: NSView, Settings_v { if widget != .speed { self.addSubview(SelectTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * 2, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Update interval", + title: LocalizedString("Update interval"), action: #selector(changeUpdateInterval), items: self.listOfUpdateIntervals.map{ "\($0) sec" }, selected: "\(self.updateIntervalValue) sec" @@ -69,7 +69,7 @@ internal class Settings: NSView, Settings_v { self.addSubview(ToggleTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * 0, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Show removable disks", + title: LocalizedString("Show removable disks"), action: #selector(toggleRemovable), state: self.removableState )) @@ -85,7 +85,7 @@ internal class Settings: NSView, Settings_v { height: 30 )) - let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), "Disk to show") + let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), LocalizedString("Disk to show")) rowTitle.font = NSFont.systemFont(ofSize: 13, weight: .light) rowTitle.textColor = .textColor diff --git a/Modules/GPU/popup.swift b/Modules/GPU/popup.swift index 54477896..6409265e 100644 --- a/Modules/GPU/popup.swift +++ b/Modules/GPU/popup.swift @@ -141,7 +141,7 @@ private class GPUView: NSView { width: circleSize, height: circleSize )) - self.temperatureCirle!.toolTip = "GPU temperature" + self.temperatureCirle!.toolTip = LocalizedString("GPU temperature") view.addSubview(chartView) view.addSubview(self.temperatureCirle!) @@ -185,7 +185,7 @@ private class GPUView: NSView { width: circleSize, height: circleSize )) - self.utilizationCircle!.toolTip = "GPU utilization" + self.utilizationCircle!.toolTip = LocalizedString("GPU utilization") view.addSubview(chartView) view.addSubview(self.utilizationCircle!) diff --git a/Modules/GPU/settings.swift b/Modules/GPU/settings.swift index 4381afbc..4c99ea64 100644 --- a/Modules/GPU/settings.swift +++ b/Modules/GPU/settings.swift @@ -58,7 +58,7 @@ internal class Settings: NSView, Settings_v { self.addSubview(SelectTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * num, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Update interval", + title: LocalizedString("Update interval"), action: #selector(changeUpdateInterval), items: self.listOfUpdateIntervals.map{ "\($0) sec" }, selected: "\(self.updateIntervalValue) sec" @@ -77,7 +77,7 @@ internal class Settings: NSView, Settings_v { height: 30 )) - let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), "GPU to show") + let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), LocalizedString("GPU to show")) rowTitle.font = NSFont.systemFont(ofSize: 13, weight: .light) rowTitle.textColor = .textColor diff --git a/Modules/Memory/popup.swift b/Modules/Memory/popup.swift index fe124610..20b78977 100644 --- a/Modules/Memory/popup.swift +++ b/Modules/Memory/popup.swift @@ -64,13 +64,13 @@ internal class Popup: NSView { let container: NSView = NSView(frame: NSRect(x: 0, y: 10, width: view.frame.width, height: self.dashboardHeight-20)) self.circle = CircleGraphView(frame: NSRect(x: (container.frame.width - container.frame.height)/2, y: 0, width: container.frame.height, height: container.frame.height), segments: []) - self.circle!.toolTip = "RAM usage" + self.circle!.toolTip = LocalizedString("Memory usage") container.addSubview(self.circle!) let centralWidth: CGFloat = self.dashboardHeight-20 let sideWidth: CGFloat = (view.frame.width - centralWidth - (Constants.Popup.margins*2))/2 self.level = PressureView(frame: NSRect(x: (sideWidth - 60)/2, y: 10, width: 60, height: 50)) - self.level!.toolTip = "Memory pressure" + self.level!.toolTip = LocalizedString("Memory pressure") view.addSubview(self.level!) view.addSubview(container) @@ -80,7 +80,7 @@ internal class Popup: NSView { private func initChart() { let y: CGFloat = self.frame.height - self.dashboardHeight - Constants.Popup.separatorHeight - let separator = SeparatorView("Usage history", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Usage history"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: y - self.chartHeight, width: self.frame.width, height: self.chartHeight)) @@ -97,24 +97,24 @@ internal class Popup: NSView { private func initDetails() { let y: CGFloat = self.frame.height - self.dashboardHeight - self.chartHeight - (Constants.Popup.separatorHeight*2) - let separator = SeparatorView("Details", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Details"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.detailsHeight, width: self.frame.width, height: self.detailsHeight)) - self.totalField = PopupRow(view, n: 5, title: "Total:", value: "") - self.usedField = PopupRow(view, n: 4, title: "Used:", value: "") + self.totalField = PopupRow(view, n: 5, title: "\(LocalizedString("Total")):", value: "") + self.usedField = PopupRow(view, n: 4, title: "\(LocalizedString("Used")):", value: "") - self.activeField = PopupWithColorRow(view, color: NSColor.systemBlue, n: 3, title: "App:", value: "") - self.wiredField = PopupWithColorRow(view, color: NSColor.systemOrange, n: 2, title: "Wired:", value: "") - self.compressedField = PopupWithColorRow(view, color: NSColor.systemPink, n: 1, title: "Compressed:", value: "") - self.freeField = PopupWithColorRow(view, color: NSColor.lightGray.withAlphaComponent(0.5), n: 0, title: "Free:", value: "") + self.activeField = PopupWithColorRow(view, color: NSColor.systemBlue, n: 3, title: "\(LocalizedString("App")):", value: "") + self.wiredField = PopupWithColorRow(view, color: NSColor.systemOrange, n: 2, title: "\(LocalizedString("Wired")):", value: "") + self.compressedField = PopupWithColorRow(view, color: NSColor.systemPink, n: 1, title: "\(LocalizedString("Compressed")):", value: "") + self.freeField = PopupWithColorRow(view, color: NSColor.lightGray.withAlphaComponent(0.5), n: 0, title: "\(LocalizedString("Free")):", value: "") self.addSubview(view) } private func initProcesses() { - let separator = SeparatorView("Top processes", origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Top processes"), origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.processesHeight)) diff --git a/Modules/Memory/settings.swift b/Modules/Memory/settings.swift index a786c00f..7f92dac5 100644 --- a/Modules/Memory/settings.swift +++ b/Modules/Memory/settings.swift @@ -51,7 +51,7 @@ internal class Settings: NSView, Settings_v { self.addSubview(SelectTitleRow( frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin + (rowHeight + Constants.Settings.margin) * num, width: self.frame.width - (Constants.Settings.margin*2), height: rowHeight), - title: "Update interval", + title: LocalizedString("Update interval"), action: #selector(changeUpdateInterval), items: self.listOfUpdateIntervals.map{ "\($0) sec" }, selected: "\(self.updateIntervalValue) sec" diff --git a/Modules/Net/popup.swift b/Modules/Net/popup.swift index c0225122..5b0779bd 100644 --- a/Modules/Net/popup.swift +++ b/Modules/Net/popup.swift @@ -67,14 +67,14 @@ internal class Popup: NSView { let view: NSView = NSView(frame: NSRect(x: 0, y: self.frame.height - self.dashboardHeight, width: self.frame.width, height: self.dashboardHeight)) let leftPart: NSView = NSView(frame: NSRect(x: 0, y: 0, width: view.frame.width / 2, height: view.frame.height)) - let uploadFields = self.topValueView(leftPart, title: "Upload", color: NSColor.systemRed) + let uploadFields = self.topValueView(leftPart, title: LocalizedString("Uploading"), color: NSColor.systemRed) self.uploadView = uploadFields.0 self.uploadValueField = uploadFields.1 self.uploadUnitField = uploadFields.2 self.uploadStateView = uploadFields.3 let rightPart: NSView = NSView(frame: NSRect(x: view.frame.width / 2, y: 0, width: view.frame.width / 2, height: view.frame.height)) - let downloadFields = self.topValueView(rightPart, title: "Download", color: NSColor.systemBlue) + let downloadFields = self.topValueView(rightPart, title: LocalizedString("Downloading"), color: NSColor.systemBlue) self.downloadView = downloadFields.0 self.downloadValueField = downloadFields.1 self.downloadUnitField = downloadFields.2 @@ -88,7 +88,7 @@ internal class Popup: NSView { private func initChart() { let y: CGFloat = self.frame.height - self.dashboardHeight - Constants.Popup.separatorHeight - let separator = SeparatorView("Usage history", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Usage history"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: y - self.chartHeight, width: self.frame.width, height: self.chartHeight)) @@ -105,26 +105,26 @@ internal class Popup: NSView { private func initDetails() { let y: CGFloat = self.frame.height - self.dashboardHeight - self.chartHeight - (Constants.Popup.separatorHeight*2) - let separator = SeparatorView("Details", origin: NSPoint(x: 0, y: y), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Details"), origin: NSPoint(x: 0, y: y), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: separator.frame.origin.y - self.detailsHeight, width: self.frame.width, height: self.detailsHeight)) - self.publicIPField = PopupRow(view, n: 4, title: "Public IP:", value: "") - self.localIPField = PopupRow(view, n: 3, title: "Local IP:", value: "") - self.interfaceField = PopupRow(view, n: 2, title: "Interface:", value: "") - self.ssidField = PopupRow(view, n: 1, title: "Network:", value: "") - self.macAdressField = PopupRow(view, n: 0, title: "Physical address:", value: "") + self.publicIPField = PopupRow(view, n: 4, title: "\(LocalizedString("Public IP")):", value: "") + self.localIPField = PopupRow(view, n: 3, title: "\(LocalizedString("Local IP")):", value: "") + self.interfaceField = PopupRow(view, n: 2, title: "\(LocalizedString("Interface")):", value: "") + self.ssidField = PopupRow(view, n: 1, title: "\(LocalizedString("Network")):", value: "") + self.macAdressField = PopupRow(view, n: 0, title: "\(LocalizedString("Physical address")):", value: "") self.publicIPField?.addTracking() self.localIPField?.addTracking() self.ssidField?.addTracking() self.macAdressField?.addTracking() - self.publicIPField?.toolTip = "Click to copy public IP address" - self.localIPField?.toolTip = "Click to copy local IP address" - self.ssidField?.toolTip = "Click to copy wifi name" - self.macAdressField?.toolTip = "Click to copy mac address" + self.publicIPField?.toolTip = LocalizedString("Click to copy public IP address") + self.localIPField?.toolTip = LocalizedString("Click to copy local IP address") + self.ssidField?.toolTip = LocalizedString("Click to copy wifi name") + self.macAdressField?.toolTip = LocalizedString("Click to copy mac address") self.publicIPField?.isSelectable = true self.localIPField?.isSelectable = true @@ -135,7 +135,7 @@ internal class Popup: NSView { } private func initProcesses() { - let separator = SeparatorView("Top processes", origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) + let separator = SeparatorView(LocalizedString("Top processes"), origin: NSPoint(x: 0, y: self.processesHeight), width: self.frame.width) self.addSubview(separator) let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.processesHeight)) @@ -237,19 +237,19 @@ internal class Popup: NSView { self.interfaceField?.stringValue = "\(interface.displayName) (\(interface.BSDName))" self.macAdressField?.stringValue = interface.address } else { - self.interfaceField?.stringValue = "Unknown" - self.macAdressField?.stringValue = "Unknown" + self.interfaceField?.stringValue = LocalizedString("Unknown") + self.macAdressField?.stringValue = LocalizedString("Unknown") } if value.connectionType == .wifi { self.ssidField?.stringValue = value.ssid ?? "Unknown" } else { - self.ssidField?.stringValue = "Unavailable" + self.ssidField?.stringValue = LocalizedString("Unavailable") } if self.publicIPField?.stringValue != value.raddr { if value.raddr == nil { - self.publicIPField?.stringValue = "Unknown" + self.publicIPField?.stringValue = LocalizedString("Unknown") } else { if value.countryCode == nil { self.publicIPField?.stringValue = value.raddr! @@ -259,7 +259,7 @@ internal class Popup: NSView { } } if self.localIPField?.stringValue != value.laddr { - self.localIPField?.stringValue = value.laddr ?? "Unknown" + self.localIPField?.stringValue = value.laddr ?? LocalizedString("Unknown") } self.initialized = true @@ -295,7 +295,7 @@ extension ValueField { } public override func mouseEntered(with: NSEvent) { - guard self.stringValue != "No connection" && self.stringValue != "Unknown" && self.stringValue != "Unavailable" else { + guard self.stringValue != LocalizedString("No connection") && self.stringValue != LocalizedString("Unknown") && self.stringValue != LocalizedString("Unavailable") else { return } @@ -307,7 +307,7 @@ extension ValueField { } public override func mouseDown(with: NSEvent) { - guard self.stringValue != "No connection" && self.stringValue != "Unknown" && self.stringValue != "Unavailable" else { + guard self.stringValue != LocalizedString("No connection") && self.stringValue != LocalizedString("Unknown") && self.stringValue != LocalizedString("Unavailable") else { return } diff --git a/Modules/Net/settings.swift b/Modules/Net/settings.swift index 2c4a20a6..fc8cb045 100644 --- a/Modules/Net/settings.swift +++ b/Modules/Net/settings.swift @@ -60,7 +60,7 @@ internal class Settings: NSView, Settings_v { private func addNetworkSelector() { let view: NSView = NSView(frame: NSRect(x: Constants.Settings.margin, y: Constants.Settings.margin, width: self.frame.width, height: 30)) - let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), "Network interface") + let rowTitle: NSTextField = LabelField(frame: NSRect(x: 0, y: (view.frame.height - 16)/2, width: view.frame.width - 52, height: 17), LocalizedString("Network interface")) rowTitle.font = NSFont.systemFont(ofSize: 13, weight: .light) rowTitle.textColor = .textColor diff --git a/Modules/Sensors/settings.swift b/Modules/Sensors/settings.swift index 9e499789..e8b03537 100644 --- a/Modules/Sensors/settings.swift +++ b/Modules/Sensors/settings.swift @@ -66,7 +66,7 @@ internal class Settings: NSView, Settings_v { self.addSubview(SelectTitleRow( frame: NSRect(x: Constants.Settings.margin, y: height - rowHeight, width: view.frame.width, height: rowHeight), - title: "Update interval", + title: LocalizedString("Update interval"), action: #selector(changeUpdateInterval), items: self.listOfUpdateIntervals.map{ "\($0) sec" }, selected: "\(self.updateIntervalValue) sec" diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index 65bde615..9c6db8c7 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -75,6 +75,7 @@ 9A944D5F24492AA60058F32A /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A944D5E24492AA60058F32A /* Constants.swift */; }; 9A944D6124492B6D0058F32A /* popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A944D6024492B6D0058F32A /* popup.swift */; }; 9A953A1424B9D22D0038EF4B /* settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A953A1324B9D22D0038EF4B /* settings.swift */; }; + 9A9B25BB24F7DE2B00C3CCE6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A9B25BD24F7DE2B00C3CCE6 /* Localizable.strings */; }; 9A9D728A24471FAE005CF997 /* SMC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D728924471FAE005CF997 /* SMC.swift */; }; 9A9EA9452476D34500E3B883 /* Update.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9EA9442476D34500E3B883 /* Update.swift */; }; 9AA4A00A2443656D00ECCF07 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AA4A0092443656D00ECCF07 /* Assets.xcassets */; }; @@ -498,6 +499,7 @@ 9A953A1324B9D22D0038EF4B /* settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settings.swift; sourceTree = ""; }; 9A998CD722A199920087ADE7 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 9A998CD922A199970087ADE7 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; }; + 9A9B25BC24F7DE2B00C3CCE6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 9A9D728924471FAE005CF997 /* SMC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SMC.swift; sourceTree = ""; }; 9A9EA9442476D34500E3B883 /* Update.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Update.swift; sourceTree = ""; }; 9AA4A0092443656D00ECCF07 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -505,6 +507,8 @@ 9AA64261244B57C800416A33 /* settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settings.swift; sourceTree = ""; }; 9AA64263244B94F300416A33 /* LineChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LineChart.swift; sourceTree = ""; }; 9AA95A6324DD7C6300801B69 /* Bridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = ""; }; + 9AAAE83524F953FC00CD92D7 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + 9AAAE83624FAA4B700CD92D7 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; 9AABEADD243FB13500668CB0 /* ModuleKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ModuleKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AABEAE0243FB13500668CB0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9AABEAE9243FB15E00668CB0 /* module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = module.swift; sourceTree = ""; }; @@ -735,6 +739,7 @@ 9A6CFC0022A1C9F5001E782D /* Assets.xcassets */, 9AABEB7D243FDEF100668CB0 /* main.swift */, 9A141101229E721200D29793 /* Info.plist */, + 9A9B25BD24F7DE2B00C3CCE6 /* Localizable.strings */, ); path = "Supporting Files"; sourceTree = ""; @@ -1265,7 +1270,8 @@ hasScannedForEncodings = 0; knownRegions = ( en, - Base, + pl, + uk, ); mainGroup = 9A1410EC229E721100D29793; productRefGroup = 9A1410F6229E721100D29793 /* Products */; @@ -1301,6 +1307,7 @@ buildActionMask = 2147483647; files = ( 9A6CFC0122A1C9F5001E782D /* Assets.xcassets in Resources */, + 9A9B25BB24F7DE2B00C3CCE6 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1636,6 +1643,19 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 9A9B25BD24F7DE2B00C3CCE6 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 9A9B25BC24F7DE2B00C3CCE6 /* en */, + 9AAAE83524F953FC00CD92D7 /* pl */, + 9AAAE83624FAA4B700CD92D7 /* uk */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 9A0C82E424460F7200FAE3D4 /* Debug */ = { isa = XCBuildConfiguration; @@ -1718,6 +1738,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1779,6 +1800,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -1852,7 +1874,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.3.1; + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1884,7 +1906,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 2.3.1; + MARKETING_VERSION = 2.3.0; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Localized Contents/en.xliff b/Stats/Supporting Files/Stats/en.xcloc/Localized Contents/en.xliff new file mode 100644 index 00000000..888f0755 --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Localized Contents/en.xliff @@ -0,0 +1,190 @@ + + + +
+ +
+ + + LaunchAtLogin + LaunchAtLogin + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + ModuleKit + ModuleKit + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Battery + Battery + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + CPU + CPU + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Disk + Disk + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + GPU + GPU + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Memory + Memory + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Net + Net + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Sensors + Sensors + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + Stats + Stats + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+ +
+ +
+ + + StatsKit + StatsKit + Bundle name + + + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. + Copyright (human-readable) + + +
+
diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/LaunchAtLogin/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/LaunchAtLogin/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..16c65b4a --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/LaunchAtLogin/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "LaunchAtLogin"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/ModuleKit/Supporting Files/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/ModuleKit/Supporting Files/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..c89c550d --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/ModuleKit/Supporting Files/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "ModuleKit"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Battery/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Battery/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..3f516a10 --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Battery/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Battery"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/CPU/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/CPU/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..81a3ebe5 --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/CPU/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "CPU"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Disk/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Disk/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..95d74fa2 --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Disk/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Disk"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/GPU/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/GPU/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..10fbf91b --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/GPU/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "GPU"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Memory/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Memory/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..fd142604 --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Memory/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Memory"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Net/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Net/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..a6975f6f --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Net/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Net"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Sensors/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Sensors/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..af1aa58b --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Modules/Sensors/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Sensors"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..226c714a --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "Stats"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/Localizable.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/Localizable.strings new file mode 100644 index 00000000..c1ff3f6c --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/Stats/Supporting Files/en.lproj/Localizable.strings @@ -0,0 +1,7 @@ +/* + Localizable.strings + Stats + + Created by Samuel Grant on 27/08/2020. + Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. +*/ diff --git a/Stats/Supporting Files/Stats/en.xcloc/Source Contents/StatsKit/en.lproj/InfoPlist.strings b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/StatsKit/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..16ca442b --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/Source Contents/StatsKit/en.lproj/InfoPlist.strings @@ -0,0 +1,4 @@ +/* Bundle name */ +"CFBundleName" = "StatsKit"; +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved."; diff --git a/Stats/Supporting Files/Stats/en.xcloc/contents.json b/Stats/Supporting Files/Stats/en.xcloc/contents.json new file mode 100644 index 00000000..55e6f60f --- /dev/null +++ b/Stats/Supporting Files/Stats/en.xcloc/contents.json @@ -0,0 +1,11 @@ +{ + "developmentRegion" : "en", + "targetLocale" : "en", + "toolInfo" : { + "toolBuildNumber" : "11E708", + "toolID" : "com.apple.dt.xcode", + "toolName" : "Xcode", + "toolVersion" : "11.6" + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/Stats/Supporting Files/en.lproj/Localizable.strings b/Stats/Supporting Files/en.lproj/Localizable.strings new file mode 100644 index 00000000..2d965a0d --- /dev/null +++ b/Stats/Supporting Files/en.lproj/Localizable.strings @@ -0,0 +1,134 @@ +// +// Localizable.strings +// Stats +// +// Created by Serhiy Mytrovtsiy on 27/08/2020. +// Using Swift 5.0. +// Running on macOS 10.15. +// +// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. +// + +// Words +"Unknown" = "Unknown"; +"Version" = "Version"; +"Processor" = "Processor"; +"Memory" = "Memory"; +"Graphics" = "Graphics"; +"Disk" = "Disk"; +"Close" = "Close"; +"Download" = "Download"; +"Install" = "Install"; +"Cancel" = "Cancel"; +"Unavailable" = "Unavailable"; +"Yes" = "Yes"; +"No" = "No"; + +// Alerts +"New version available" = "New version available"; +"Click to install the new version of Stats" = "Click to install the new version of Stats"; +"Successfully updated" = "Successfully updated"; +"Stats was updated to v" = "Stats was updated to v%@"; + +// Settings +"Open Activity Monitor" = "Open Activity Monitor"; +"Report a bug" = "Report a bug"; +"Close application" = "Close application"; +"Open application settings" = "Open application settings"; +"Open moduleName settings" = "Open %@ settings"; + +// Application settings +"Update application" = "Update application"; +"Check for updates" = "Check for updates"; +"Show icon in dock" = "Show icon in dock"; +"Start at login" = "Start at login"; + +// Update +"The latest version of Stats installed" = "The latest version of Stats installed"; +"Downloading..." = "Downloading..."; +"Current version: " = "Current version: "; +"Latest version: " = "Latest version: "; + +// Widgets +"Color" = "Color"; +"Label" = "Label"; +"Box" = "Box"; +"Frame" = "Frame"; +"Value" = "Value"; +"Colorize" = "Colorize"; +"Colorize value" = "Colorize value"; +"Additional information" = "Additional information"; +"Reverse values order" = "Reverse values order"; + +// Module Kit +"Open module settings" = "Open module settings"; +"Select widget" = "Select %@ widget"; +"Update interval" = "Update interval"; +"Usage history" = "Usage history"; +"Details" = "Details"; +"Top processes" = "Top processes"; +"Pictogram" = "Pictogram"; + +// CPU +"CPU usage" = "CPU usage"; +"CPU temperature" = "CPU temperature"; +"System" = "System"; +"User" = "User"; +"Idle" = "Idle"; +"Show usage per core" = "Show usage per core"; +"Show hyper-threading cores" = "Show hyper-threading cores"; + +// GPU +"GPU to show" = "GPU to show"; +"GPU temperature" = "GPU temperature"; +"GPU utilization" = "GPU utilization"; + +// Memory +"Memory usage" = "Memory usage"; +"Memory pressure" = "Memory pressure"; +"Total" = "Total"; +"Used" = "Used"; +"App" = "App"; +"Wired" = "Wired"; +"Compressed" = "Compressed"; +"Free" = "Free"; + +// Disk +"Show removable disks" = "Show removable disks"; +"Used disk memory" = "Used %@ from %@"; +"Disk to show" = "Disk to show"; + +// Network +"Uploading" = "Upload"; +"Downloading" = "Download"; +"Public IP" = "Public IP"; +"Local IP" = "Local IP"; +"Interface" = "Interface"; +"Network" = "Network"; +"Physical address" = "Physical address"; +"Click to copy public IP address" = "Click to copy public IP address"; +"Click to copy local IP address" = "Click to copy local IP address"; +"Click to copy wifi name" = "Click to copy wifi name"; +"Click to copy mac address" = "Click to copy mac address"; +"No connection" = "No connection"; +"Network interface" = "Network interface"; + +// Battery +"Source" = "Source"; +"Time" = "Time"; +"Health" = "Health"; +"Battery" = "Battery"; +"Amperage" = "Amperage"; +"Voltage" = "Voltage"; +"Temperature" = "Temperature"; +"Power adapter" = "Power adapter"; +"Power" = "Power"; +"Is charging" = "Is charging"; +"Time to discharge" = "Time to discharge"; +"Time to charge" = "Time to charge"; +"Calculating" = "Calculating"; +"Fully charged" = "Fully charged"; +"Not connected" = "Not connected"; +"Low level notification" = "Low level notification"; +"Low battery" = "Low battery"; +"Battery remaining" = "%@% remaining"; diff --git a/Stats/Supporting Files/pl.lproj/Localizable.strings b/Stats/Supporting Files/pl.lproj/Localizable.strings new file mode 100644 index 00000000..13e9abd9 --- /dev/null +++ b/Stats/Supporting Files/pl.lproj/Localizable.strings @@ -0,0 +1,134 @@ +// +// Localizable.strings +// Stats +// +// Created by Serhiy Mytrovtsiy on 27/08/2020. +// Using Swift 5.0. +// Running on macOS 10.15. +// +// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. +// + +// Words +"Unknown" = "Unknown"; +"Version" = "Wersja"; +"Processor" = "Procesor"; +"Memory" = "Pamięć"; +"Graphics" = "Grafika"; +"Disk" = "Dysk"; +"Close" = "Zamknij"; +"Download" = "Pobierz"; +"Install" = "Zainstaluj"; +"Cancel" = "Cancel"; +"Unavailable" = "Niedostępny"; +"Yes" = "Tak"; +"No" = "Nie"; + +// Alerts +"New version available" = "Nowa wersja dostępna"; +"Click to install the new version of Stats" = "Kliknij aby zainstalować nową wersję"; +"Successfully updated" = "Zaktualizowano pomyślnie"; +"Stats was updated to v" = "Stats został zaktualizowany do v%@"; + +// Settings +"Open Activity Monitor" = "Otwórz Activity Monitor"; +"Report a bug" = "Zgłoś problem"; +"Close application" = "Zamknij program"; +"Open application settings" = "Otwórz ustawienie"; +"Open moduleName settings" = "Otwórz ustawienie %@"; + +// Application settings +"Update application" = "Aktualizuj aplikacje"; +"Check for updates" = "Sprawdzaj aktualizacje"; +"Show icon in dock" = "Pokaż ikonę w docku"; +"Start at login" = "Uruchom przy logowaniu"; + +// Update +"The latest version of Stats installed" = "Najnowsza wersja Stats zainstalowana"; +"Downloading..." = "Pobieranie..."; +"Current version: " = "Aktualna wersja: "; +"Latest version: " = "Najnowsza wersja: "; + +// Widgets +"Color" = "Kolor"; +"Label" = "Etykieta"; +"Box" = "Box"; +"Frame" = "Ramka"; +"Value" = "Wartość"; +"Colorize" = "Kolorowanie"; +"Colorize value" = "Kolorowanie wartości"; +"Additional information" = "Informacja dodatkowa"; +"Reverse values order" = "Zmień kolejność wyświetlania"; + +// Module Kit +"Open module settings" = "Otwórz ustawienie modulu"; +"Select widget" = "Wybierz %@ widget"; +"Update interval" = "Interwał odświeżania"; +"Usage history" = "Historia zużycia"; +"Details" = "Szczegóły"; +"Top processes" = "Top procesy"; +"Pictogram" = "Ikonka"; + +// CPU +"CPU usage" = "Obciążenie CPU"; +"CPU temperature" = "Temperatura CPU"; +"System" = "System"; +"User" = "Użytkownik"; +"Idle" = "Bezczynna"; +"Show usage per core" = "Pokaż obciążenie na rdzeń"; +"Show hyper-threading cores" = "Pokaż rdzenie Hyper-Threading"; + +// GPU +"GPU to show" = "GPU do wyświetlania"; +"GPU temperature" = "Temperatura GPU"; +"GPU utilization" = "Obciążenie GPU"; + +// Memory +"Memory usage" = "Wykorzystanie pamięci"; +"Memory pressure" = "Poziom obciążenia"; +"Total" = "Całość"; +"Used" = "Użyta"; +"App" = "Aplikacje"; +"Wired" = "Układowa"; +"Compressed" = "Skompresowana"; +"Free" = "Wolna"; + +// Disk +"Show removable disks" = "Pokaż dyski wymienne"; +"Used disk memory" = "Wykorzystano %@ z %@"; +"Disk to show" = "Aktywny dysk"; + +// Network +"Uploading" = "Wysyłka"; +"Downloading" = "Pobieranie"; +"Public IP" = "Publiczny IP"; +"Local IP" = "Lokalny IP"; +"Interface" = "Interfejs"; +"Network" = "Sieć"; +"Physical address" = "Adres fizyczny"; +"Click to copy public IP address" = "Kliknij aby skopiować publiczny adres IP"; +"Click to copy local IP address" = "Kliknij aby skopiować lokalny adres IP"; +"Click to copy wifi name" = "Kliknij aby skopiować nazwę Wi-Fi"; +"Click to copy mac address" = "Kliknij aby skopiować adres fizyczny"; +"No connection" = "Brak połączenia"; +"Network interface" = "Interfejs sieciowy"; + +// Battery +"Source" = "Źródło"; +"Time" = "Czas"; +"Health" = "Zdrowie"; +"Battery" = "Bateria"; +"Amperage" = "Natężenie"; +"Voltage" = "Napięcie"; +"Temperature" = "Termaratura"; +"Power adapter" = "Zasilacz"; +"Power" = "Status"; +"Is charging" = "Ładuje"; +"Time to discharge" = "Czas do rozładowania"; +"Time to charge" = "Czas do naładowania"; +"Calculating" = "Obliczenie"; +"Fully charged" = "W pełni naładowana"; +"Not connected" = "Nie podłączona"; +"Low level notification" = "Powiadomienie o niskim poziomie"; +"Low battery" = "Niski poziom baterii"; +"Battery remaining" = "Pozostało %@%"; diff --git a/Stats/Supporting Files/uk.lproj/Localizable.strings b/Stats/Supporting Files/uk.lproj/Localizable.strings new file mode 100644 index 00000000..bf60cbf3 --- /dev/null +++ b/Stats/Supporting Files/uk.lproj/Localizable.strings @@ -0,0 +1,134 @@ +// +// Localizable.strings +// Stats +// +// Created by Serhiy Mytrovtsiy on 27/08/2020. +// Using Swift 5.0. +// Running on macOS 10.15. +// +// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved. +// + +// Words +"Unknown" = "Невідомо"; +"Version" = "Версія"; +"Processor" = "Процесор"; +"Memory" = "Память"; +"Graphics" = "Графіка"; +"Disk" = "Диск"; +"Close" = "Закрити"; +"Download" = "Завантажити"; +"Install" = "Встановити"; +"Cancel" = "Скасувати"; +"Unavailable" = "Недоступно"; +"Yes" = "Так"; +"No" = "Ні"; + +// Alerts +"New version available" = "Доступна нова версія"; +"Click to install the new version of Stats" = "Натисніть щоб встановити нову версію Stats"; +"Successfully updated" = "Успішно оновленно"; +"Stats was updated to v" = "Stats оновлено до v%@"; + +// Settings +"Open Activity Monitor" = "Відкрити Монітор активності"; +"Report a bug" = "Повідомити про помилку"; +"Close application" = "Закрити програму"; +"Open application settings" = "Відкрити налаштування"; +"Open moduleName settings" = "Відкрити налаштування %@"; + +// Application settings +"Update application" = "Оновити програму"; +"Check for updates" = "Перевірити оновленя"; +"Show icon in dock" = "Показувати іконку в dock"; +"Start at login" = "Запуск при логуванні"; + +// Update +"The latest version of Stats installed" = "Встановлено останню версію"; +"Downloading..." = "Завантаження..."; +"Current version: " = "Поточна версія: "; +"Latest version: " = "Остання версія: "; + +// Widgets +"Color" = "Колір"; +"Label" = "Етикетка"; +"Box" = "Box"; +"Frame" = "Рамка"; +"Value" = "Значення"; +"Colorize" = "Розфарбувати"; +"Colorize value" = "Розфарбувати значення"; +"Additional information" = "Додаткова інформація"; +"Reverse values order" = "Змінити порядок сортування"; + +// Module Kit +"Open module settings" = "Відкрити налаштування модуля"; +"Select widget" = "Активувати %@ віджет"; +"Update interval" = "Інтервал обновлень"; +"Usage history" = "Історія використання"; +"Details" = "Деталі"; +"Top processes" = "Топ процесів"; +"Pictogram" = "Піктограма"; + +// CPU +"CPU usage" = "Використання процесора"; +"CPU temperature" = "Температура процесора"; +"System" = "Система"; +"User" = "Користувач"; +"Idle" = "Вільно"; +"Show usage per core" = "Показати використання на одне ядро"; +"Show hyper-threading cores" = "Показати Hyper-Threading ядра"; + +// GPU +"GPU to show" = "Активний графічний процесор"; +"GPU temperature" = "Температура графічного процесора"; +"GPU utilization" = "Навантаженість графічного процесора"; + +// Memory +"Memory usage" = "Навантаженість пам’яті"; +"Memory pressure" = "Рівень навантаження"; +"Total" = "Загально"; +"Used" = "Використовується"; +"App" = "Програми"; +"Wired" = "Постійна"; +"Compressed" = "Стисненна"; +"Free" = "Вільна"; + +// DiskF +"Show removable disks" = "Показати знімні диски"; +"Used disk memory" = "Використано %@ з %@"; +"Disk to show" = "Активний диск"; + +// Network +"Uploading" = "Висилання"; +"Downloading" = "Завантаження"; +"Public IP" = "Публічний IP"; +"Local IP" = "Локальний IP"; +"Interface" = "Інтерфейс"; +"Network" = "Мережа"; +"Physical address" = "Фізичний адрес"; +"Click to copy public IP address" = "Натисніть, щоб скопіювати публічний IP"; +"Click to copy local IP address" = "Натисніть, щоб скопіювати локальний IP"; +"Click to copy wifi name" = "Натисніть, щоб скопіювати назву wifi"; +"Click to copy mac address" = "Натисніть, щоб скопіювати фізичний адрес"; +"No connection" = "Немає з'єднання"; +"Network interface" = "Мережевий інтерфейс"; + +// Battery +"Source" = "Джерело"; +"Time" = "Час"; +"Health" = "Стан батареї"; +"Battery" = "Акумулятор"; +"Amperage" = "Сила струму"; +"Voltage" = "Напруга"; +"Temperature" = "Температура"; +"Power adapter" = "Блок живлення"; +"Power" = "Статус"; +"Is charging" = "Заряджається"; +"Time to discharge" = "Час до розрядки"; +"Time to charge" = "Час до зарядки"; +"Calculating" = "Обчислення"; +"Fully charged" = "Повністю заряджений"; +"Not connected" = "Непід'єднана"; +"Low level notification" = "Повідомлення про низький рівень заряду"; +"Low battery" = "Низький заряд батареї"; +"Battery remaining" = "%@% залишилось"; diff --git a/Stats/Views/AppSettings.swift b/Stats/Views/AppSettings.swift index fe827086..117249a1 100644 --- a/Stats/Views/AppSettings.swift +++ b/Stats/Views/AppSettings.swift @@ -43,9 +43,9 @@ class ApplicationSettings: NSView { public override func viewDidMoveToWindow() { if let button = self.updateButton, let version = updater.latest { if version.newest { - button.title = "Update application" + button.title = LocalizedString("Update application") } else { - button.title = "Check for updates" + button.title = LocalizedString("Check for updates") } } } @@ -60,12 +60,12 @@ class ApplicationSettings: NSView { var processorInfo = "" if systemKit.device.info?.cpu?.name != "" { - processorInfo += "\(systemKit.device.info?.cpu?.name ?? "Unknown")\n" + processorInfo += "\(systemKit.device.info?.cpu?.name ?? LocalizedString("Unknown"))\n" } processorInfo += "\(systemKit.device.info?.cpu?.physicalCores ?? 0) cores (\(systemKit.device.info?.cpu?.logicalCores ?? 0) threads)" leftPanel.addSubview(makeInfoRow( frame: NSRect(x: rowHorizontalPadding, y: rowHeight*3, width: leftPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight+8), - title: "Processor", + title: LocalizedString("Processor"), value: processorInfo )) @@ -74,12 +74,12 @@ class ApplicationSettings: NSView { sizeFormatter.countStyle = .memory leftPanel.addSubview(makeInfoRow( frame: NSRect(x: rowHorizontalPadding, y: rowHeight*2, width: leftPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "Memory", + title: LocalizedString("Memory"), value: "\(sizeFormatter.string(fromByteCount: Int64(systemKit.device.info?.ram?.total ?? 0)))" )) let gpus = systemKit.device.info?.gpu - var gpu: String = "Unknown" + var gpu: String = LocalizedString("Unknown") if gpus != nil { if gpus?.count == 1 { gpu = gpus![0].name @@ -90,21 +90,21 @@ class ApplicationSettings: NSView { } leftPanel.addSubview(makeInfoRow( frame: NSRect(x: rowHorizontalPadding, y: rowHeight*1, width: leftPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "GPU", + title: LocalizedString("Graphics"), value: gpu )) leftPanel.addSubview(makeInfoRow( frame: NSRect(x: rowHorizontalPadding, y: 0, width: leftPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "Disk", - value: "\(systemKit.device.info?.disk?.model ?? systemKit.device.info?.disk?.name ?? "Unknown")" + title: LocalizedString("Disk"), + value: "\(systemKit.device.info?.disk?.model ?? systemKit.device.info?.disk?.name ?? LocalizedString("Unknown"))" )) let rightPanel: NSView = NSView(frame: NSRect(x: self.width/2, y: 0, width: view.frame.width/2, height: view.frame.height)) rightPanel.addSubview(makeSelectRow( frame: NSRect(x: rowHorizontalPadding*0.5, y: rowHeight*2, width: rightPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "Check for updates", + title: LocalizedString("Check for updates"), action: #selector(self.toggleUpdateInterval), items: updateIntervals.allCases.map{ $0.rawValue }, selected: self.updateIntervalValue @@ -112,14 +112,14 @@ class ApplicationSettings: NSView { rightPanel.addSubview(makeSettingRow( frame: NSRect(x: rowHorizontalPadding*0.5, y: rowHeight*1, width: rightPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "Show icon in dock", + title: LocalizedString("Show icon in dock"), action: #selector(self.toggleDock), state: store.bool(key: "dockIcon", defaultValue: false) )) rightPanel.addSubview(makeSettingRow( frame: NSRect(x: rowHorizontalPadding*0.5, y: 0, width: rightPanel.frame.width - (rowHorizontalPadding*1.5), height: rowHeight), - title: "Start at login", + title: LocalizedString("Start at login"), action: #selector(self.toggleLaunchAtLogin), state: LaunchAtLogin.isEnabled )) @@ -242,7 +242,7 @@ class ApplicationSettings: NSView { let osField: NSTextField = TextView(frame: NSRect(x: 0, y: 52, width: leftPanel.frame.width, height: 18)) osField.alignment = .center osField.font = NSFont.systemFont(ofSize: 12, weight: .regular) - osField.stringValue = "macOS \(systemKit.device.os?.name ?? "Unknown") (\(systemKit.device.os?.version.getFullVersion() ?? ""))" + osField.stringValue = "macOS \(systemKit.device.os?.name ?? LocalizedString("Unknown")) (\(systemKit.device.os?.version.getFullVersion() ?? ""))" osField.isSelectable = true leftPanel.addSubview(deviceImageView) @@ -266,14 +266,14 @@ class ApplicationSettings: NSView { statsVersion.alignment = .center statsVersion.font = NSFont.systemFont(ofSize: 12, weight: .regular) let versionNumber = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String - statsVersion.stringValue = "Version \(versionNumber)" + statsVersion.stringValue = "\(LocalizedString("Version")) \(versionNumber)" statsVersion.isSelectable = true infoView.addSubview(statsName) infoView.addSubview(statsVersion) let button: NSButton = NSButton(frame: NSRect(x: (rightPanel.frame.width - 160)/2, y: 20, width: 160, height: 28)) - button.title = "Check for updates" + button.title = LocalizedString("Check for updates") button.bezelStyle = .rounded button.target = self button.action = #selector(updateAction) diff --git a/Stats/Views/Settings.swift b/Stats/Views/Settings.swift index ba0edff5..1bef1938 100644 --- a/Stats/Views/Settings.swift +++ b/Stats/Views/Settings.swift @@ -130,9 +130,9 @@ private class SettingsView: NSView { let buttonsView: NSView = NSView(frame: NSRect(x: 0, y: 0, width: navigationWidth, height: buttonHeight)) buttonsView.wantsLayer = true - buttonsView.addSubview(self.makeButton(4, title: "Open Activity Monitor", image: "chart", action: #selector(openActivityMonitor))) - buttonsView.addSubview(self.makeButton(3, title: "Report a bug", image: "bug", action: #selector(reportBug))) - buttonsView.addSubview(self.makeButton(1, title: "Close application", image: "power", action: #selector(closeApp))) + buttonsView.addSubview(self.makeButton(4, title: LocalizedString("Open Activity Monitor"), image: "chart", action: #selector(openActivityMonitor))) + buttonsView.addSubview(self.makeButton(3, title: LocalizedString("Report a bug"), image: "bug", action: #selector(reportBug))) + buttonsView.addSubview(self.makeButton(1, title: LocalizedString("Close application"), image: "power", action: #selector(closeApp))) let mainView: NSView = NSView(frame: NSRect(x: navigationWidth, y: 1, width: frame.width - navigationWidth-1, height: frame.height-1)) mainView.wantsLayer = true @@ -300,7 +300,7 @@ private class MenuView: NSView { super.init(frame: NSRect(x: 0, y: self.height*CGFloat(n), width: width, height: self.height)) self.wantsLayer = true self.layer?.backgroundColor = .clear - self.toolTip = "Open \(title == "Stats" ? "application" : "\(title) module") settings" + self.toolTip = title == "Stats" ? LocalizedString("Open application settings") : LocalizedString("Open moduleName settings", title) let rect = NSRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height) let trackingArea = NSTrackingArea(rect: rect, options: [NSTrackingArea.Options.activeAlways, NSTrackingArea.Options.mouseEnteredAndExited, NSTrackingArea.Options.activeInActiveApp], owner: self, userInfo: ["menu": title]) diff --git a/Stats/Views/Update.swift b/Stats/Views/Update.swift index 7973784a..6a8aa99d 100644 --- a/Stats/Views/Update.swift +++ b/Stats/Views/Update.swift @@ -97,9 +97,9 @@ private class UpdateView: NSView { let title: NSTextField = TextView(frame: NSRect(x: 0, y: view.frame.height - 20, width: view.frame.width, height: 18)) title.font = NSFont.systemFont(ofSize: 14, weight: .semibold) title.alignment = .center - title.stringValue = "New version available" + title.stringValue = LocalizedString("New version available") - let currentVersionString = "Current version: \(version.current)" + let currentVersionString = "\(LocalizedString("Current version: "))\(version.current)" let currentVersionWidth = currentVersionString.widthOfString(usingFont: .systemFont(ofSize: 13, weight: .light)) let currentVersion: NSTextField = TextView(frame: NSRect( x: (view.frame.width-currentVersionWidth)/2, @@ -109,7 +109,7 @@ private class UpdateView: NSView { )) currentVersion.stringValue = currentVersionString - let latestVersionString = "Latest version: \(version.latest)" + let latestVersionString = "\(LocalizedString("Latest version: "))\(version.latest)" let latestVersionWidth = latestVersionString.widthOfString(usingFont: .systemFont(ofSize: 13, weight: .light)) let latestVersion: NSTextField = TextView(frame: NSRect( x: (view.frame.width-currentVersionWidth)/2, @@ -120,13 +120,13 @@ private class UpdateView: NSView { latestVersion.stringValue = latestVersionString let closeButton: NSButton = NSButton(frame: NSRect(x: 0, y: 0, width: view.frame.width/2, height: 26)) - closeButton.title = "Close" + closeButton.title = LocalizedString("Close") closeButton.bezelStyle = .rounded closeButton.action = #selector(self.close) closeButton.target = self let downloadButton: NSButton = NSButton(frame: NSRect(x: view.frame.width/2, y: 0, width: view.frame.width/2, height: 26)) - downloadButton.title = "Download" + downloadButton.title = LocalizedString("Download") downloadButton.bezelStyle = .rounded downloadButton.action = #selector(self.download) downloadButton.target = self @@ -145,10 +145,10 @@ private class UpdateView: NSView { let title: NSTextField = TextView(frame: NSRect(x: 0, y: ((view.frame.height - 18)/2)+20, width: view.frame.width, height: 18)) title.font = NSFont.systemFont(ofSize: 14, weight: .regular) title.alignment = .center - title.stringValue = "The latest version of Stats installed" + title.stringValue = LocalizedString("The latest version of Stats installed") let button: NSButton = NSButton(frame: NSRect(x: 0, y: 0, width: view.frame.width, height: 26)) - button.title = "Close" + button.title = LocalizedString("Close") button.bezelStyle = .rounded button.action = #selector(self.close) button.target = self @@ -174,7 +174,7 @@ private class UpdateView: NSView { let title: NSTextField = TextView(frame: NSRect(x: 0, y: view.frame.height - 28, width: view.frame.width, height: 18)) title.font = NSFont.systemFont(ofSize: 14, weight: .semibold) title.alignment = .center - title.stringValue = "Downloading..." + title.stringValue = LocalizedString("Downloading...") let progressBar: NSProgressIndicator = NSProgressIndicator() progressBar.frame = NSRect(x: 20, y: 64, width: view.frame.width - 40, height: 22) @@ -189,13 +189,13 @@ private class UpdateView: NSView { state.stringValue = "0%" let closeButton: NSButton = NSButton(frame: NSRect(x: 0, y: 0, width: view.frame.width, height: 26)) - closeButton.title = "Close" + closeButton.title = LocalizedString("Cancel") closeButton.bezelStyle = .rounded closeButton.action = #selector(self.close) closeButton.target = self let installButton: NSButton = NSButton(frame: NSRect(x: view.frame.width/2, y: 0, width: view.frame.width/2, height: 26)) - installButton.title = "Install" + installButton.title = LocalizedString("Install") installButton.bezelStyle = .rounded installButton.action = #selector(self.install) installButton.target = self diff --git a/Stats/helpers.swift b/Stats/helpers.swift index db038c28..f9cea225 100644 --- a/Stats/helpers.swift +++ b/Stats/helpers.swift @@ -67,7 +67,10 @@ extension AppDelegate { } if IsNewestVersion(currentVersion: prevVersion, latestVersion: currentVersion) { - _ = showNotification(title: "Successfully updated", subtitle: "Stats was updated to v\(currentVersion)", id: "updated-from-\(prevVersion)-to-\(currentVersion)" + _ = showNotification( + title: LocalizedString("Successfully updated"), + subtitle: LocalizedString("Stats was updated to v", currentVersion), + id: "updated-from-\(prevVersion)-to-\(currentVersion)" ) } @@ -110,12 +113,12 @@ extension AppDelegate { os_log(.debug, log: log, "show update window because new version of app found: %s", "\(version.latest)") self.updateNotification.identifier = "new-version-\(version.latest)" - self.updateNotification.title = "New version available" - self.updateNotification.subtitle = "Click to install the new version of Stats" + self.updateNotification.title = LocalizedString("New version available") + self.updateNotification.subtitle = LocalizedString("Click to install the new version of Stats") self.updateNotification.soundName = NSUserNotificationDefaultSoundName self.updateNotification.hasActionButton = true - self.updateNotification.actionButtonTitle = "Install" + self.updateNotification.actionButtonTitle = LocalizedString("Install") self.updateNotification.userInfo = ["url": version.url] NSUserNotificationCenter.default.delegate = self diff --git a/StatsKit/extensions.swift b/StatsKit/extensions.swift index abb5efcf..f2630c98 100644 --- a/StatsKit/extensions.swift +++ b/StatsKit/extensions.swift @@ -952,3 +952,13 @@ public struct Log: TextOutputStream { } } } + +public func LocalizedString(_ key: String, _ params: String..., comment: String = "") -> String { + var string = NSLocalizedString(key, comment: comment) + if !params.isEmpty { + for param in params { + string = string.replacingOccurrences(of: "%@", with: param) + } + } + return string +}