-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SSDK-503] Rename Discover to Category (#172)
### Description **Ticket**: [SSDK-503](https://mapbox.atlassian.net/browse/SSDK-503) - Rename MapboxSearch/PublicAPI/Use Cases/Discover API/ → Category - Rename Discover.Query.Category → Category.Item - Remove SearchUI.SearchCategory - replace it with `typealias SearchCategory = MapboxSearch.Category.Item` - This consolidates both the MapboxSearch and MapboxSearchUI `Category` structs into 1 representation that has additional extension in the SearchUI module. - Replace the old SearchUI.SearchCategory predefined category instances with MapboxSearch.Category.Item predefined instances that support all of geocoding (legacyName), and SBS and search-box (canonicalId) ### Checklist - [x] Update `CHANGELOG` [SSDK-503]: https://mapbox.atlassian.net/browse/SSDK-503
- Loading branch information
Showing
22 changed files
with
558 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Sources/MapboxSearch/PublicAPI/Common/Bundle+Extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Foundation | ||
|
||
extension Bundle { | ||
/// Access to MapboxSearch resource bundle | ||
/// | ||
/// Resource bundle may be located: | ||
/// - inside dynamic framework | ||
/// | ||
/// `MapboxSearch.framework/MapboxSearch.bundle` | ||
/// - as a plain bundle in the application root (for static lib distribution) | ||
/// | ||
/// `Demo.app/MapboxSearch.bundle` | ||
/// | ||
/// We use `CoreSearchResultResponse` class as an anchor to detect the bundle | ||
#if SWIFT_PACKAGE | ||
static let mapboxSearch = module | ||
#else | ||
static let mapboxSearch = Bundle(for: CoreSearchResultResponse.self) | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
// Copyright © 2024 Mapbox. All rights reserved. | ||
|
||
import Foundation | ||
|
||
enum Strings { | ||
enum Categories { | ||
static let gas = NSLocalizedString( | ||
"gas_station.short", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Gas title" | ||
) | ||
static let parking = NSLocalizedString( | ||
"parking_lot", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Parking title" | ||
) | ||
static let food = NSLocalizedString( | ||
"restaurant.alias.food", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Food title" | ||
) | ||
static let cafe = NSLocalizedString( | ||
"cafe", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Cafe title" | ||
) | ||
static let restaurant = NSLocalizedString( | ||
"restaurants", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Restaurants title" | ||
) | ||
static let bar = NSLocalizedString( | ||
"bar", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Bars title" | ||
) | ||
static let coffeeShop = NSLocalizedString( | ||
"cafe.long", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Coffee Shop title" | ||
) | ||
static let hotel = NSLocalizedString( | ||
"hotel", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Hotel title" | ||
) | ||
static let gasStation = NSLocalizedString( | ||
"gas_station", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Gas Station title" | ||
) | ||
static let chargingStation = NSLocalizedString( | ||
"charging_station", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category EV Charging Station title" | ||
) | ||
static let busStation = NSLocalizedString( | ||
"bus_station", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Bus station title" | ||
) | ||
static let railwayStation = NSLocalizedString( | ||
"railway_station", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Train station title" | ||
) | ||
static let shoppingMall = NSLocalizedString( | ||
"shopping_mall", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Shopping malls title" | ||
) | ||
static let grocery = NSLocalizedString( | ||
"grocery", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Supermarket / Grocery title" | ||
) | ||
static let clothingStore = NSLocalizedString( | ||
"clothing_store", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Clothing / shoes title" | ||
) | ||
static let pharmacy = NSLocalizedString( | ||
"pharmacy", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Pharmacy title" | ||
) | ||
static let museum = NSLocalizedString( | ||
"museum", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Museums title" | ||
) | ||
static let park = NSLocalizedString( | ||
"park", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Parks title" | ||
) | ||
static let cinema = NSLocalizedString( | ||
"cinema", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Movie Theaters title" | ||
) | ||
static let fitnessCentre = NSLocalizedString( | ||
"fitness_center", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Gym / Fitness title" | ||
) | ||
static let nightclub = NSLocalizedString( | ||
"nightclub", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Night clubs title" | ||
) | ||
static let autoRepair = NSLocalizedString( | ||
"auto_repair", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Auto repair / mechanic title" | ||
) | ||
static let atm = NSLocalizedString( | ||
"atm", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category ATM title" | ||
) | ||
static let hospital = NSLocalizedString( | ||
"hospital", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category Hospital title" | ||
) | ||
static let emergencyRoom = NSLocalizedString( | ||
"emergency_room", | ||
tableName: "Categories", | ||
bundle: .mapboxSearch, | ||
comment: "Category ER title" | ||
) | ||
} | ||
} |
Oops, something went wrong.