Skip to content

Commit

Permalink
Add back init(verbatim title: String)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Mar 4, 2023
1 parent 12f02aa commit 2b15a0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/MenuBuilder/MenuItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public struct MenuItem: AnyMenuItem {
modifiers = [{ item in item.title = title }]
}

/// Creates a menu item with the given (non-localized) title.
public init(verbatim title: String) {
modifiers = [{ item in item.title = title }]
}

/// Creates a menu item with the given localized string key used as the title.
public init(localized title: String, table: String? = nil, bundle: Bundle = .main) {
modifiers = [{ item in item.title = bundle.localizedString(forKey: title, value: nil, table: table) }]
Expand Down

0 comments on commit 2b15a0c

Please sign in to comment.