mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-03-28 06:50:08 +01:00
♻️ Added withDisplayName string helper
This commit is contained in:
@@ -164,4 +164,10 @@ extension String {
|
|||||||
of: "^[0-9]*$", // 1
|
of: "^[0-9]*$", // 1
|
||||||
options: .regularExpression) != nil
|
options: .regularExpression) != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Helpers
|
||||||
|
|
||||||
|
var withDisplayName: String {
|
||||||
|
return self.replacing("PHP Monitor", with: App.displayName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ class App {
|
|||||||
/** Use to determine whether a loaded testable configuration is being used. */
|
/** Use to determine whether a loaded testable configuration is being used. */
|
||||||
static var hasLoadedTestableConfiguration: Bool = false
|
static var hasLoadedTestableConfiguration: Bool = false
|
||||||
|
|
||||||
/** The name of the app. Has EAP suffixed when an actual EAP build. */
|
/** The display name of the app, as declared in Info.plist. */
|
||||||
static var name: String {
|
static var displayName: String {
|
||||||
return Bundle.main.infoDictionary?["CFBundleName"] as! String
|
return Bundle.main.infoDictionary?["CFBundleName"] as! String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,9 +127,9 @@ extension StatusMenu {
|
|||||||
@MainActor func addCoreMenuItems() {
|
@MainActor func addCoreMenuItems() {
|
||||||
addItems([
|
addItems([
|
||||||
NSMenuItem.separator(),
|
NSMenuItem.separator(),
|
||||||
NSMenuItem(title: "mi_about".localized.replacing("PHP Monitor", with: App.name),
|
NSMenuItem(title: "mi_about".localized.withDisplayName,
|
||||||
action: #selector(MainMenu.openAbout)),
|
action: #selector(MainMenu.openAbout)),
|
||||||
NSMenuItem(title: "mi_quit".localized.replacing("PHP Monitor", with: App.name),
|
NSMenuItem(title: "mi_quit".localized.withDisplayName,
|
||||||
action: #selector(MainMenu.terminateApp), keyEquivalent: "q")
|
action: #selector(MainMenu.terminateApp), keyEquivalent: "q")
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user