mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Use iOS localization handling for strings. (#803)
This commit is contained in:
parent
6efae84c04
commit
d01349a60e
@ -87,8 +87,6 @@ class AppCoordinator: AppCoordinatorProtocol {
|
|||||||
|
|
||||||
setupStateMachine()
|
setupStateMachine()
|
||||||
|
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
observeApplicationState()
|
observeApplicationState()
|
||||||
observeNetworkState()
|
observeNetworkState()
|
||||||
}
|
}
|
||||||
|
@ -72,15 +72,10 @@ public enum UntranslatedL10n {
|
|||||||
extension UntranslatedL10n {
|
extension UntranslatedL10n {
|
||||||
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||||||
// No need to check languages, we always default to en for untranslated strings
|
// No need to check languages, we always default to en for untranslated strings
|
||||||
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: "en") else {
|
guard let bundle = Bundle.lprojBundle(for: "en") else { return key }
|
||||||
// no translations for the desired language
|
|
||||||
return key
|
|
||||||
}
|
|
||||||
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
||||||
return String(format: format, locale: Locale(identifier: "en"), arguments: args)
|
return String(format: format, locale: Locale(identifier: "en"), arguments: args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class BundleToken {}
|
|
||||||
|
|
||||||
// swiftlint:enable all
|
// swiftlint:enable all
|
||||||
|
@ -802,31 +802,24 @@ public enum L10n {
|
|||||||
|
|
||||||
extension L10n {
|
extension L10n {
|
||||||
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||||||
let languages = Bundle.preferredLanguages
|
// Use preferredLocalizations to get a language that is in the bundle and the user's preferred list of languages.
|
||||||
|
let languages = Bundle.overrideLocalizations ?? Bundle.app.preferredLocalizations
|
||||||
|
|
||||||
for language in languages {
|
for language in languages {
|
||||||
if let translation = trIn(language, table, key, args) {
|
if let translation = trIn(language, table, key, args) {
|
||||||
return translation
|
return translation
|
||||||
// If we can't find a translation for this language
|
|
||||||
// we check if we can find one by stripping the region
|
|
||||||
} else if let langCode = Locale(identifier: language).language.languageCode?.identifier,
|
|
||||||
let translation = trIn(langCode, table, key, args) {
|
|
||||||
return translation
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return key
|
|
||||||
}
|
}
|
||||||
|
return Bundle.app.developmentLocalization.flatMap { trIn($0, table, key, args) } ?? key
|
||||||
|
}
|
||||||
|
|
||||||
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String? {
|
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String? {
|
||||||
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: language) else {
|
guard let bundle = Bundle.lprojBundle(for: language) else { return nil }
|
||||||
// no translations for the desired language
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
||||||
return String(format: format, locale: Locale(identifier: language), arguments: args)
|
let translation = String(format: format, locale: Locale(identifier: language), arguments: args)
|
||||||
|
guard translation != key else { return nil }
|
||||||
|
return translation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class BundleToken {}
|
|
||||||
|
|
||||||
// swiftlint:enable all
|
// swiftlint:enable all
|
||||||
|
@ -17,43 +17,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public extension Bundle {
|
public extension Bundle {
|
||||||
private static var cachedLocalizationBundles = [String: Bundle]()
|
/// The top-level bundle that contains the entire app.
|
||||||
|
|
||||||
/// 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.
|
|
||||||
func lprojBundle(for language: String) -> Bundle? {
|
|
||||||
if let bundle = Self.cachedLocalizationBundles[language] {
|
|
||||||
return bundle
|
|
||||||
}
|
|
||||||
|
|
||||||
guard let lprojURL = Bundle.app.url(forResource: language, withExtension: "lproj") else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
let bundle = Bundle(url: lprojURL)
|
|
||||||
Self.cachedLocalizationBundles[language] = bundle
|
|
||||||
|
|
||||||
return bundle
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Preferred app language for translations. Takes the highest priority in translations. The priority list for translations:
|
|
||||||
/// - `Bundle.elementLanguage`
|
|
||||||
/// - `Locale.preferredLanguages`
|
|
||||||
/// - `Bundle.elementFallbackLanguage`
|
|
||||||
static var elementLanguage: String? {
|
|
||||||
didSet {
|
|
||||||
preferredLanguages = calculatePreferredLanguages()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Preferred fallback language for translations. Only used for strings not translated neither to `elementLanguage` nor to one of the user's preferred languages.
|
|
||||||
static var elementFallbackLanguage: String? {
|
|
||||||
didSet {
|
|
||||||
preferredLanguages = calculatePreferredLanguages()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static var app: Bundle {
|
static var app: Bundle {
|
||||||
var bundle = Bundle.main
|
var bundle = Bundle.main
|
||||||
if bundle.bundleURL.pathExtension == "appex" {
|
if bundle.bundleURL.pathExtension == "appex" {
|
||||||
@ -66,15 +30,28 @@ public extension Bundle {
|
|||||||
return bundle
|
return bundle
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Preferred languages in the priority order.
|
// MARK: - Localisation
|
||||||
private(set) static var preferredLanguages: [String] = calculatePreferredLanguages()
|
|
||||||
|
|
||||||
private static func calculatePreferredLanguages() -> [String] {
|
private static var cachedLocalizationBundles = [String: Bundle]()
|
||||||
var set = Set<String>()
|
|
||||||
return ([Bundle.elementLanguage] +
|
/// Get an lproj language bundle from the receiver bundle.
|
||||||
Locale.preferredLanguages +
|
/// - Parameter language: The language to try to load.
|
||||||
[Bundle.elementFallbackLanguage])
|
/// - Returns: The lproj bundle if found otherwise nil.
|
||||||
.compactMap { $0 }
|
static func lprojBundle(for language: String) -> Bundle? {
|
||||||
.filter { set.insert($0).inserted }
|
if let bundle = cachedLocalizationBundles[language] {
|
||||||
|
return bundle
|
||||||
|
}
|
||||||
|
|
||||||
|
guard let lprojURL = Bundle.app.url(forResource: language, withExtension: "lproj") else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
let bundle = Bundle(url: lprojURL)
|
||||||
|
cachedLocalizationBundles[language] = bundle
|
||||||
|
|
||||||
|
return bundle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Overrides `Bundle.app.preferredLocalizations` for testing translations.
|
||||||
|
static var overrideLocalizations: [String]?
|
||||||
}
|
}
|
||||||
|
@ -160,9 +160,9 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
|||||||
MultipartFormData(key: "version", type: .text(value: InfoPlistReader.main.bundleShortVersionString)),
|
MultipartFormData(key: "version", type: .text(value: InfoPlistReader.main.bundleShortVersionString)),
|
||||||
MultipartFormData(key: "build", type: .text(value: InfoPlistReader.main.bundleVersion)),
|
MultipartFormData(key: "build", type: .text(value: InfoPlistReader.main.bundleVersion)),
|
||||||
MultipartFormData(key: "os", type: .text(value: os)),
|
MultipartFormData(key: "os", type: .text(value: os)),
|
||||||
MultipartFormData(key: "resolved_language", type: .text(value: Bundle.preferredLanguages[0])),
|
MultipartFormData(key: "resolved_languages", type: .text(value: Bundle.app.preferredLocalizations.joined(separator: ", "))),
|
||||||
MultipartFormData(key: "user_language", type: .text(value: Bundle.elementLanguage ?? "null")),
|
MultipartFormData(key: "user_languages", type: .text(value: Locale.preferredLanguages.joined(separator: ", "))),
|
||||||
MultipartFormData(key: "fallback_language", type: .text(value: Bundle.elementFallbackLanguage ?? "null")),
|
MultipartFormData(key: "fallback_language", type: .text(value: Bundle.app.developmentLocalization ?? "null")),
|
||||||
MultipartFormData(key: "local_time", type: .text(value: localTime)),
|
MultipartFormData(key: "local_time", type: .text(value: localTime)),
|
||||||
MultipartFormData(key: "utc_time", type: .text(value: utcTime)),
|
MultipartFormData(key: "utc_time", type: .text(value: utcTime)),
|
||||||
MultipartFormData(key: "base_bundle_identifier", type: .text(value: InfoPlistReader.main.baseBundleIdentifier))
|
MultipartFormData(key: "base_bundle_identifier", type: .text(value: InfoPlistReader.main.baseBundleIdentifier))
|
||||||
|
@ -102,7 +102,7 @@ class NotificationManager: NSObject, NotificationManagerProtocol {
|
|||||||
appDisplayName: "\(InfoPlistReader.main.bundleDisplayName) (iOS)",
|
appDisplayName: "\(InfoPlistReader.main.bundleDisplayName) (iOS)",
|
||||||
deviceDisplayName: UIDevice.current.name,
|
deviceDisplayName: UIDevice.current.name,
|
||||||
profileTag: pusherProfileTag(),
|
profileTag: pusherProfileTag(),
|
||||||
lang: Bundle.preferredLanguages.first ?? "en")
|
lang: Bundle.app.preferredLocalizations.first ?? "en")
|
||||||
try await clientProxy.setPusher(with: configuration)
|
try await clientProxy.setPusher(with: configuration)
|
||||||
MXLog.info("[NotificationManager] set pusher succeeded")
|
MXLog.info("[NotificationManager] set pusher succeeded")
|
||||||
return true
|
return true
|
||||||
|
@ -34,8 +34,6 @@ class UITestsAppCoordinator: AppCoordinatorProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
guard let screenID = Tests.screenID else { fatalError("Unable to launch with unknown screen.") }
|
guard let screenID = Tests.screenID else { fatalError("Unable to launch with unknown screen.") }
|
||||||
|
|
||||||
let mockScreen = MockScreen(id: screenID)
|
let mockScreen = MockScreen(id: screenID)
|
||||||
|
@ -24,13 +24,6 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
|||||||
var handler: ((UNNotificationContent) -> Void)?
|
var handler: ((UNNotificationContent) -> Void)?
|
||||||
var modifiedContent: UNMutableNotificationContent?
|
var modifiedContent: UNMutableNotificationContent?
|
||||||
|
|
||||||
override init() {
|
|
||||||
// Use `en` as fallback language
|
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
super.init()
|
|
||||||
}
|
|
||||||
|
|
||||||
override func didReceive(_ request: UNNotificationRequest,
|
override func didReceive(_ request: UNNotificationRequest,
|
||||||
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
||||||
guard !DataProtectionManager.isDeviceLockedAfterReboot(containerURL: URL.appGroupContainerDirectory),
|
guard !DataProtectionManager.isDeviceLockedAfterReboot(containerURL: URL.appGroupContainerDirectory),
|
||||||
|
@ -76,17 +76,12 @@ import Foundation
|
|||||||
extension {{enumName}} {
|
extension {{enumName}} {
|
||||||
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||||||
// No need to check languages, we always default to en for untranslated strings
|
// No need to check languages, we always default to en for untranslated strings
|
||||||
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: "en") else {
|
guard let bundle = Bundle.lprojBundle(for: "en") else { return key }
|
||||||
// no translations for the desired language
|
|
||||||
return key
|
|
||||||
}
|
|
||||||
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
||||||
return String(format: format, locale: Locale(identifier: "en"), arguments: args)
|
return String(format: format, locale: Locale(identifier: "en"), arguments: args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class BundleToken {}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
// No string found
|
// No string found
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -75,33 +75,26 @@ import Foundation
|
|||||||
|
|
||||||
extension {{enumName}} {
|
extension {{enumName}} {
|
||||||
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||||||
let languages = Bundle.preferredLanguages
|
// Use preferredLocalizations to get a language that is in the bundle and the user's preferred list of languages.
|
||||||
|
let languages = Bundle.overrideLocalizations ?? Bundle.app.preferredLocalizations
|
||||||
|
|
||||||
for language in languages {
|
for language in languages {
|
||||||
if let translation = trIn(language, table, key, args) {
|
if let translation = trIn(language, table, key, args) {
|
||||||
return translation
|
return translation
|
||||||
// If we can't find a translation for this language
|
|
||||||
// we check if we can find one by stripping the region
|
|
||||||
} else if let langCode = Locale(identifier: language).language.languageCode?.identifier,
|
|
||||||
let translation = trIn(langCode, table, key, args) {
|
|
||||||
return translation
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return key
|
|
||||||
}
|
}
|
||||||
|
return Bundle.app.developmentLocalization.flatMap { trIn($0, table, key, args) } ?? key
|
||||||
|
}
|
||||||
|
|
||||||
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String? {
|
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String? {
|
||||||
guard let bundle = Bundle(for: BundleToken.self).lprojBundle(for: language) else {
|
guard let bundle = Bundle.lprojBundle(for: language) else { return nil }
|
||||||
// no translations for the desired language
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
||||||
return String(format: format, locale: Locale(identifier: language), arguments: args)
|
let translation = String(format: format, locale: Locale(identifier: language), arguments: args)
|
||||||
|
guard translation != key else { return nil }
|
||||||
|
return translation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class BundleToken {}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
// No string found
|
// No string found
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -24,9 +24,6 @@ struct Application {
|
|||||||
"UI_TESTS_SCREEN": identifier.rawValue
|
"UI_TESTS_SCREEN": identifier.rawValue
|
||||||
]
|
]
|
||||||
|
|
||||||
// Use the same fallback language as the real app so translation comparison works
|
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
app.launch()
|
app.launch()
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
@ -20,21 +20,13 @@ import XCTest
|
|||||||
class LocalizationTests: XCTestCase {
|
class LocalizationTests: XCTestCase {
|
||||||
/// Test ElementL10n considers app language changes
|
/// Test ElementL10n considers app language changes
|
||||||
func testAppLanguage() {
|
func testAppLanguage() {
|
||||||
// set app language to English
|
// set app language to English
|
||||||
Bundle.elementLanguage = "en"
|
Bundle.overrideLocalizations = ["en"]
|
||||||
|
|
||||||
XCTAssertEqual(L10n.testLanguageIdentifier, "en")
|
XCTAssertEqual(L10n.testLanguageIdentifier, "en")
|
||||||
|
|
||||||
// set app language to Italian
|
// set app language to Italian
|
||||||
Bundle.elementLanguage = "it"
|
Bundle.overrideLocalizations = ["it"]
|
||||||
|
|
||||||
XCTAssertEqual(L10n.testLanguageIdentifier, "it")
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Test fallback language for a language not supported at all
|
|
||||||
func testStripRegionIfRegionalTranslationIsNotAvailable() {
|
|
||||||
// set app language to something that includes also a region (it-IT)
|
|
||||||
Bundle.elementLanguage = "it-IT"
|
|
||||||
|
|
||||||
XCTAssertEqual(L10n.testLanguageIdentifier, "it")
|
XCTAssertEqual(L10n.testLanguageIdentifier, "it")
|
||||||
}
|
}
|
||||||
@ -42,8 +34,7 @@ class LocalizationTests: XCTestCase {
|
|||||||
/// Test fallback language for a language not supported at all
|
/// Test fallback language for a language not supported at all
|
||||||
func testFallbackOnNotSupportedLanguage() {
|
func testFallbackOnNotSupportedLanguage() {
|
||||||
// set app language to something Element don't support at all (chose non existing identifier)
|
// set app language to something Element don't support at all (chose non existing identifier)
|
||||||
Bundle.elementLanguage = "xx"
|
Bundle.overrideLocalizations = ["xx"]
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
XCTAssertEqual(L10n.testLanguageIdentifier, "en")
|
XCTAssertEqual(L10n.testLanguageIdentifier, "en")
|
||||||
}
|
}
|
||||||
@ -51,8 +42,7 @@ class LocalizationTests: XCTestCase {
|
|||||||
/// Test fallback language for a language supported but poorly translated
|
/// Test fallback language for a language supported but poorly translated
|
||||||
func testFallbackOnNotTranslatedKey() {
|
func testFallbackOnNotTranslatedKey() {
|
||||||
// set app language to something Element supports but use a key that is not translated (we have a key that should never be translated)
|
// set app language to something Element supports but use a key that is not translated (we have a key that should never be translated)
|
||||||
Bundle.elementLanguage = "it"
|
Bundle.overrideLocalizations = ["it"]
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
XCTAssertEqual(L10n.testLanguageIdentifier, "it")
|
XCTAssertEqual(L10n.testLanguageIdentifier, "it")
|
||||||
XCTAssertEqual(L10n.testUntranslatedDefaultLanguageIdentifier, "en")
|
XCTAssertEqual(L10n.testUntranslatedDefaultLanguageIdentifier, "en")
|
||||||
@ -61,19 +51,19 @@ class LocalizationTests: XCTestCase {
|
|||||||
/// Test plurals that ElementL10n considers app language changes
|
/// Test plurals that ElementL10n considers app language changes
|
||||||
func testPlurals() {
|
func testPlurals() {
|
||||||
// set app language to English
|
// set app language to English
|
||||||
Bundle.elementLanguage = "en"
|
Bundle.overrideLocalizations = ["en"]
|
||||||
|
|
||||||
XCTAssertEqual(L10n.commonMemberCount(1), "1 member")
|
XCTAssertEqual(L10n.commonMemberCount(1), "1 member")
|
||||||
XCTAssertEqual(L10n.commonMemberCount(2), "2 members")
|
XCTAssertEqual(L10n.commonMemberCount(2), "2 members")
|
||||||
|
|
||||||
// set app language to Italian
|
// set app language to Italian
|
||||||
Bundle.elementLanguage = "it"
|
Bundle.overrideLocalizations = ["it"]
|
||||||
|
|
||||||
XCTAssertEqual(L10n.commonMemberCount(1), "1 membro")
|
XCTAssertEqual(L10n.commonMemberCount(1), "1 membro")
|
||||||
XCTAssertEqual(L10n.commonMemberCount(2), "2 membri")
|
XCTAssertEqual(L10n.commonMemberCount(2), "2 membri")
|
||||||
|
|
||||||
// // set app language to Polish
|
// // set app language to Polish
|
||||||
// Bundle.elementLanguage = "pl"
|
// Bundle.overrideLocalizations = ["pl"]
|
||||||
//
|
//
|
||||||
// XCTAssertEqual(L10n.commonMemberCount(1), "1 sekunda") // one
|
// XCTAssertEqual(L10n.commonMemberCount(1), "1 sekunda") // one
|
||||||
// XCTAssertEqual(L10n.commonMemberCount(2), "2 sekundy") // few
|
// XCTAssertEqual(L10n.commonMemberCount(2), "2 sekundy") // few
|
||||||
@ -83,8 +73,7 @@ class LocalizationTests: XCTestCase {
|
|||||||
/// Test plurals fallback language for a language not supported at all
|
/// Test plurals fallback language for a language not supported at all
|
||||||
func testPluralsFallbackOnNotSupportedLanguage() {
|
func testPluralsFallbackOnNotSupportedLanguage() {
|
||||||
// set app language to something Element don't support at all ("invalid identifier")
|
// set app language to something Element don't support at all ("invalid identifier")
|
||||||
Bundle.elementLanguage = "xx"
|
Bundle.overrideLocalizations = ["xx"]
|
||||||
Bundle.elementFallbackLanguage = "en"
|
|
||||||
|
|
||||||
XCTAssertEqual(L10n.commonMemberCount(1), "1 member")
|
XCTAssertEqual(L10n.commonMemberCount(1), "1 member")
|
||||||
XCTAssertEqual(L10n.commonMemberCount(2), "2 members")
|
XCTAssertEqual(L10n.commonMemberCount(2), "2 members")
|
||||||
|
@ -63,7 +63,7 @@ final class NotificationManagerTests: XCTestCase {
|
|||||||
XCTAssertEqual(clientProxy.setPusherArgument?.appDisplayName, "\(InfoPlistReader.main.bundleDisplayName) (iOS)")
|
XCTAssertEqual(clientProxy.setPusherArgument?.appDisplayName, "\(InfoPlistReader.main.bundleDisplayName) (iOS)")
|
||||||
XCTAssertEqual(clientProxy.setPusherArgument?.deviceDisplayName, UIDevice.current.name)
|
XCTAssertEqual(clientProxy.setPusherArgument?.deviceDisplayName, UIDevice.current.name)
|
||||||
XCTAssertNotNil(clientProxy.setPusherArgument?.profileTag)
|
XCTAssertNotNil(clientProxy.setPusherArgument?.profileTag)
|
||||||
XCTAssertEqual(clientProxy.setPusherArgument?.lang, Bundle.preferredLanguages.first)
|
XCTAssertEqual(clientProxy.setPusherArgument?.lang, Bundle.app.preferredLocalizations.first)
|
||||||
guard case let .http(data) = clientProxy.setPusherArgument?.kind else {
|
guard case let .http(data) = clientProxy.setPusherArgument?.kind else {
|
||||||
XCTFail("Http kind expected")
|
XCTFail("Http kind expected")
|
||||||
return
|
return
|
||||||
|
1
changelog.d/pr-803.change
Normal file
1
changelog.d/pr-803.change
Normal file
@ -0,0 +1 @@
|
|||||||
|
Use iOS localization handling for strings.
|
Loading…
x
Reference in New Issue
Block a user