metatext-app-ios-iphone-ipad/Extensions/SearchScope+Extensions.swift

44 lines
1.4 KiB
Swift
Raw Normal View History

2021-01-25 03:10:41 +01:00
// Copyright © 2021 Metabolist. All rights reserved.
import Foundation
import ViewModels
2021-01-25 08:42:39 +01:00
extension SearchScope {
2021-01-31 02:43:48 +01:00
func title(statusWord: AppPreferences.StatusWord) -> String {
2021-01-25 03:10:41 +01:00
switch self {
case .all:
return NSLocalizedString("search.scope.all", comment: "")
case .accounts:
return NSLocalizedString("search.scope.accounts", comment: "")
case .statuses:
2021-01-31 02:43:48 +01:00
switch statusWord {
case .toot:
return NSLocalizedString("search.scope.statuses.toot", comment: "")
case .post:
return NSLocalizedString("search.scope.statuses.post", comment: "")
}
2021-01-25 03:10:41 +01:00
case .tags:
return NSLocalizedString("search.scope.tags", comment: "")
}
}
2021-01-25 08:42:39 +01:00
2021-01-31 02:43:48 +01:00
func moreDescription(statusWord: AppPreferences.StatusWord) -> String? {
2021-01-25 08:42:39 +01:00
switch self {
case .all:
return nil
case .accounts:
return NSLocalizedString("more-results.accounts", comment: "")
case .statuses:
2021-01-31 02:43:48 +01:00
switch statusWord {
case .toot:
return NSLocalizedString("more-results.statuses.toot", comment: "")
case .post:
return NSLocalizedString("more-results.statuses.post", comment: "")
}
2021-01-25 08:42:39 +01:00
case .tags:
return NSLocalizedString("more-results.tags", comment: "")
}
}
2021-01-25 03:10:41 +01:00
}