Skip to content

Commit

Permalink
Merge pull request #60 from nodes-ios/develop
Browse files Browse the repository at this point in the history
Bringing stuff from develop to master
  • Loading branch information
mariusc authored Sep 22, 2022
2 parents 9987823 + 7f202e4 commit 917de7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions LocalizationManager/Classes/Manager/LocalizationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class LocalizationManager<Language, Descriptor: LocalizationDescriptor> w
}

/// The previous date the localizations were updated
internal var lastUpdatedDate: Date? {
public var lastUpdatedDate: Date? {
get {
let timeInterval = userDefaults.double(forKey: Constants.Keys.lastUpdatedDate)
if timeInterval == 0 {
Expand Down Expand Up @@ -381,7 +381,8 @@ public class LocalizationManager<Language, Descriptor: LocalizationDescriptor> w
self.handleLocalizationModels(
descriptors: configs,
acceptHeaderUsed: languageAcceptHeader,
completion: completion)
completion: completion
)

case .failure(let error):
//error fetching configs
Expand Down Expand Up @@ -615,6 +616,7 @@ public class LocalizationManager<Language, Descriptor: LocalizationDescriptor> w
localizableObjectDictonary.removeAll()

if includingPersisted {
lastUpdatedDate = .distantPast
try deletePersistedLocalizations()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class LocalizationManagerTests: XCTestCase {
try manager.clearLocalizations(includingPersisted: true)
let newFilePaths = try FileManager.default.contentsOfDirectory(at: dir, includingPropertiesForKeys: nil, options: [])
XCTAssertTrue(newFilePaths.isEmpty)
XCTAssertEqual(manager.lastUpdatedDate, Date.distantPast)
} catch {
XCTFail("Failed to get contents of directories")
}
Expand Down
2 changes: 1 addition & 1 deletion NLocalizationManager.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
#

spec.name = "NLocalizationManager"
spec.version = "3.1.3"
spec.version = "3.1.5"
spec.summary = "A manager for handling localization in your application."

# This description is used to generate tags and improve search results.
Expand Down
5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ let package = Package(
.target(
name: "LocalizationManager",
path: "LocalizationManager/Classes"
),
.testTarget(
name: "LocalizationManagerTests",
dependencies: [.target(name: "LocalizationManager")],
path: "LocalizationManagerTests"
)
]
)

0 comments on commit 917de7f

Please sign in to comment.