mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add localizations to UI tests target (#118)
This commit is contained in:
@@ -5406,7 +5406,7 @@ extension ElementL10n {
|
||||
}
|
||||
|
||||
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||||
guard let bundle = Bundle.lprojBundle(for: language) else {
|
||||
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: language) else {
|
||||
// no translations for the desired language
|
||||
return key
|
||||
}
|
||||
@@ -5415,3 +5415,5 @@ extension ElementL10n {
|
||||
}
|
||||
}
|
||||
|
||||
private final class BundleToken {}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ struct SplashScreen: View {
|
||||
Text(ElementL10n.loginSplashSubmit)
|
||||
}
|
||||
.buttonStyle(.elementAction(.xLarge))
|
||||
.accessibilityIdentifier("getStartedButton")
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.readableFrame()
|
||||
|
||||
Reference in New Issue
Block a user