Skip to content
Open
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
4 changes: 2 additions & 2 deletions LocalizedTimeAgo.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

s.source_files = 'Sources/LocalizedTimeAgo/*.swift'
s.resources = 'Resources/LocalizedTimeAgo.bundle'
s.source_files = 'Sources/LocalizedTimeAgo/*.swift'
s.resource_bundle = { 'LocalizedTimeAgo' => ['Sources/LocalizedTimeAgo/Resources/*.lproj'] }
end

178 changes: 159 additions & 19 deletions LocalizedTimeAgo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.3

// Package.swift
//
Expand Down Expand Up @@ -27,12 +27,17 @@ import PackageDescription

let package = Package(
name: "LocalizedTimeAgo",
defaultLocalization: "en",
products: [
.library(
name: "LocalizedTimeAgo",
targets: ["LocalizedTimeAgo"]),
targets: ["LocalizedTimeAgo"]
)
],
targets: [
.target(name: "LocalizedTimeAgo")
.target(
name: "LocalizedTimeAgo",
exclude: ["Info.plist"]
)
]
)
9 changes: 7 additions & 2 deletions Sources/LocalizedTimeAgo/LocalizedTimeAgo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ fileprivate class Constants {
fileprivate extension Bundle {

static var moduleBundle: Bundle {
guard let path = Bundle(for: Constants.self).resourcePath else { return .main }
return Bundle(path: path.appending("/\(Constants.resource).bundle")) ?? .main
#if SWIFT_PACKAGE
return Bundle.module
#else
let bundle = Bundle(for: Constants.self)
guard let url = bundle.url(forResource: Constants.resource, withExtension: "bundle") else { return .main }
return Bundle(url: url) ?? bundle
#endif
}

}
Expand Down