mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Add localizations to UI tests target (#118)
This commit is contained in:
@@ -10,25 +10,11 @@ import Foundation
|
||||
|
||||
public extension Bundle {
|
||||
|
||||
/// Returns the real app bundle.
|
||||
/// Can also be used in app extensions.
|
||||
static let app: Bundle = {
|
||||
let bundle = main
|
||||
if bundle.bundleURL.pathExtension == "appex" {
|
||||
// Peel off two directory levels - MY_APP.app/PlugIns/MY_APP_EXTENSION.appex
|
||||
let url = bundle.bundleURL.deletingLastPathComponent().deletingLastPathComponent()
|
||||
if let otherBundle = Bundle(url: url) {
|
||||
return otherBundle
|
||||
}
|
||||
}
|
||||
return bundle
|
||||
}()
|
||||
|
||||
/// Get an lproj language bundle from the main app bundle.
|
||||
/// Get an lproj language bundle from the receiver bundle.
|
||||
/// - Parameter language: The language to try to load.
|
||||
/// - Returns: The lproj bundle if found otherwise nil.
|
||||
@objc static func lprojBundle(for language: String) -> Bundle? {
|
||||
guard let lprojURL = Bundle.app.url(forResource: language, withExtension: "lproj") else { return nil }
|
||||
func lprojBundle(for language: String) -> Bundle? {
|
||||
guard let lprojURL = url(forResource: language, withExtension: "lproj") else { return nil }
|
||||
return Bundle(url: lprojURL)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user