-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Simulator Localization Settings
- Loading branch information
Vladislav Alekseev
committed
Dec 30, 2019
1 parent
607c3e9
commit c1a5eb4
Showing
16 changed files
with
125 additions
and
31 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Foundation | ||
|
||
public struct SimulatorLocalizationSettings: Codable, CustomStringConvertible, Hashable { | ||
public let localeIdentifier: String | ||
public let keyboards: [String] | ||
public let passcodeKeyboards: [String] | ||
public let languages: [String] | ||
public let addingEmojiKeybordHandled: Bool | ||
public let enableKeyboardExpansion: Bool | ||
public let didShowInternationalInfoAlert: Bool | ||
|
||
public init( | ||
localeIdentifier: String, | ||
keyboards: [String], | ||
passcodeKeyboards: [String], | ||
languages: [String], | ||
addingEmojiKeybordHandled: Bool, | ||
enableKeyboardExpansion: Bool, | ||
didShowInternationalInfoAlert: Bool | ||
) { | ||
self.localeIdentifier = localeIdentifier | ||
self.keyboards = keyboards | ||
self.passcodeKeyboards = passcodeKeyboards | ||
self.languages = languages | ||
self.addingEmojiKeybordHandled = addingEmojiKeybordHandled | ||
self.enableKeyboardExpansion = enableKeyboardExpansion | ||
self.didShowInternationalInfoAlert = didShowInternationalInfoAlert | ||
} | ||
|
||
public var description: String { | ||
return "<\(type(of: self)) \(localeIdentifier), keyboards: \(keyboards), passcodeKeyboards: \(passcodeKeyboards), languages: \(languages), addingEmojiKeybordHandled \(addingEmojiKeybordHandled), enableKeyboardExpansion \(enableKeyboardExpansion), didShowInternationalInfoAlert \(didShowInternationalInfoAlert)>" | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Foundation | ||
|
||
struct FbxctestSimulatorLocalizationFile: Encodable { | ||
let localeIdentifier: String | ||
let keyboards: [String] | ||
let passcodeKeyboards: [String] | ||
let languages: [String] | ||
let addingEmojiKeybordHandled: Bool | ||
let enableKeyboardExpansion: Bool | ||
let didShowInternationalInfoAlert: Bool | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case localeIdentifier = "locale_identifier" | ||
case keyboards = "keyboards" | ||
case passcodeKeyboards = "passcode_keyboards" | ||
case languages = "languages" | ||
case addingEmojiKeybordHandled = "adding_emoji_keybord_handled" | ||
case enableKeyboardExpansion = "enable_keyboard_expansion" | ||
case didShowInternationalInfoAlert = "did_show_international_info_alert" | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Tests/ModelsTestHelpers/SimulatorLocalizationSettings.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,26 @@ | ||
import Foundation | ||
import Models | ||
|
||
public final class SimulatorLocalizationSettingsFixture { | ||
public var localeIdentifier = "ru_US" | ||
public var keyboards = ["ru_RU@sw=Russian;hw=Automatic", "en_US@sw=QWERTY;hw=Automatic"] | ||
public var passcodeKeyboards = ["ru_RU@sw=Russian;hw=Automatic", "en_US@sw=QWERTY;hw=Automatic"] | ||
public var languages = ["ru-US", "en", "ru-RU"] | ||
public var addingEmojiKeybordHandled = true | ||
public var enableKeyboardExpansion = true | ||
public var didShowInternationalInfoAlert = true | ||
|
||
public init() {} | ||
|
||
public func simulatorLocalizationSettings() -> SimulatorLocalizationSettings { | ||
return SimulatorLocalizationSettings( | ||
localeIdentifier: localeIdentifier, | ||
keyboards: keyboards, | ||
passcodeKeyboards: passcodeKeyboards, | ||
languages: languages, | ||
addingEmojiKeybordHandled: addingEmojiKeybordHandled, | ||
enableKeyboardExpansion: enableKeyboardExpansion, | ||
didShowInternationalInfoAlert: didShowInternationalInfoAlert | ||
) | ||
} | ||
} |
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
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
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