Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ file_length:
error: 600

line_length:
warning: 150
warning: 190
error: 250

type_body_length:
- 300 # warning
- 400 # error

nesting:
type_level: 3
statement_level: 7

large_tuple: # warn user when using 3 values in tuple, give error if there are 4
- 3
- 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public class LocalizationManager<Language, Descriptor: LocalizationDescriptor> w
}

if let bestFit = descriptors.filter({ $0.language.isBestFit }).first {
if self.bestFitLanguage?.locale.identifier != bestFit.localeIdentifier {
if self.bestFitLanguage?.locale.identifier != bestFit.language.locale.identifier {
// Running language changed action, if best fit language is now different
self.delegate?.localizationManager(languageUpdated: bestFit.language)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ public struct DefaultLanguage: LanguageModel {
public let isDefault: Bool
public let isBestFit: Bool

enum CodingKeys: CodingKey {
case id, name, direction, locale, isDefault, isBestFit
enum CodingKeys: String, CodingKey {
case id, name, direction, locale
case isDefault = "is_default"
case isBestFit = "is_best_fit"
}

init(id: Int, name: String, direction: String,
locale: Locale, isDefault: Bool, isBestFit: Bool) {
public init(id: Int, name: String, direction: String, locale: Locale, isDefault: Bool, isBestFit: Bool) {
self.id = id
self.name = name
self.direction = direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public protocol LocalizationDescriptor: Codable {
associatedtype LanguageType: LanguageModel

var shouldUpdate: Bool { get }
var localeIdentifier: String { get }
var url: String { get }
var language: LanguageType { get }
}