mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-27 22:10:57 -04:00
Fixlint
This commit is contained in:
parent
aad7a8b423
commit
05384c581f
@ -71,8 +71,13 @@ final class CompactViewController: UIHostingController<AnyView>, UISearchControl
|
|||||||
func willPresentSearchController(_ searchController: UISearchController) {
|
func willPresentSearchController(_ searchController: UISearchController) {
|
||||||
navigationController?.setToolbarHidden(true, animated: true)
|
navigationController?.setToolbarHidden(true, animated: true)
|
||||||
navigationItem.setRightBarButton(
|
navigationItem.setRightBarButton(
|
||||||
UIBarButtonItem(title: "common.button.cancel".localized, style: .done, target: self, action: #selector(onSearchCancelled))
|
UIBarButtonItem(
|
||||||
, animated: true
|
title: "common.button.cancel".localized,
|
||||||
|
style: .done,
|
||||||
|
target: self,
|
||||||
|
action: #selector(onSearchCancelled)
|
||||||
|
),
|
||||||
|
animated: true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@objc func onSearchCancelled() {
|
@objc func onSearchCancelled() {
|
||||||
|
@ -11,15 +11,33 @@ import Foundation
|
|||||||
extension String {
|
extension String {
|
||||||
|
|
||||||
var localized: String {
|
var localized: String {
|
||||||
return NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: "")
|
NSLocalizedString(
|
||||||
|
self,
|
||||||
|
tableName: nil,
|
||||||
|
bundle: DefaultLanguages.currentBundle,
|
||||||
|
value: "",
|
||||||
|
comment: ""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func localized(withComment: String) -> String {
|
func localized(withComment: String) -> String {
|
||||||
return NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: withComment)
|
return NSLocalizedString(
|
||||||
|
self,
|
||||||
|
tableName: nil,
|
||||||
|
bundle: DefaultLanguages.currentBundle,
|
||||||
|
value: "",
|
||||||
|
comment: withComment
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func localizedWithFormat(withArgs: CVarArg...) -> String {
|
func localizedWithFormat(withArgs: CVarArg...) -> String {
|
||||||
let format = NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: "")
|
let format = NSLocalizedString(
|
||||||
|
self,
|
||||||
|
tableName: nil,
|
||||||
|
bundle: DefaultLanguages.currentBundle,
|
||||||
|
value: "",
|
||||||
|
comment: ""
|
||||||
|
)
|
||||||
|
|
||||||
switch withArgs.count {
|
switch withArgs.count {
|
||||||
case 1: return String.localizedStringWithFormat(format, withArgs[0])
|
case 1: return String.localizedStringWithFormat(format, withArgs[0])
|
||||||
@ -27,5 +45,4 @@ extension String {
|
|||||||
default: return String.localizedStringWithFormat(format, withArgs)
|
default: return String.localizedStringWithFormat(format, withArgs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user