mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: add translation to the modules name (#496)
This commit is contained in:
@@ -285,7 +285,16 @@ 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 = title == "Stats" ? localizedString("Open application settings") : localizedString("Open moduleName settings", title)
|
||||
|
||||
var toolTip = ""
|
||||
if title == "State" {
|
||||
toolTip = localizedString("Open application settings")
|
||||
} else if title == "Dashboard" {
|
||||
toolTip = localizedString("Open dashboard")
|
||||
} else {
|
||||
toolTip = localizedString("Open \(title) settings")
|
||||
}
|
||||
self.toolTip = toolTip
|
||||
|
||||
let rect = NSRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)
|
||||
let trackingArea = NSTrackingArea(
|
||||
@@ -302,13 +311,15 @@ private class MenuView: NSView {
|
||||
}
|
||||
imageView.frame = NSRect(x: 8, y: (self.height - 18)/2, width: 18, height: 18)
|
||||
imageView.wantsLayer = true
|
||||
imageView.contentTintColor = .labelColor
|
||||
if #available(OSX 10.14, *) {
|
||||
imageView.contentTintColor = .labelColor
|
||||
}
|
||||
|
||||
let titleView = TextView(frame: NSRect(x: 34, y: (self.height - 16)/2, width: 100, height: 16))
|
||||
titleView.alignment = .natural
|
||||
titleView.textColor = .labelColor
|
||||
titleView.font = NSFont.systemFont(ofSize: 13, weight: .regular)
|
||||
titleView.stringValue = title
|
||||
titleView.stringValue = localizedString(title)
|
||||
|
||||
self.addSubview(imageView)
|
||||
self.addSubview(titleView)
|
||||
|
||||
Reference in New Issue
Block a user