Decybel07 / L10n-swift

Localization of the application with ability to change language "on the fly" and support for plural form in any language.
MIT License
315 stars 32 forks source link

fails to install with swift pm #21

Closed tcurdt closed 4 years ago

tcurdt commented 5 years ago

Short description of the issue.

Swift PM fails to resolve the dependency to L10n-swift

What did you expect to happen?

It should install just like it does with other libraries. (example: Alamofire, PinLayout)

What happened instead?

The dependency does not get resolved and swift package aborts with an error.

How to reproduces this problem?

Package.swift

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "Test",
    products: [],
    dependencies: [
        .package(url: "https://github.com/Decybel07/L10n-swift.git", .upToNextMajor(from: "5.5.1")),
    ],
    targets: [
        .target(
            name: "Test",
            dependencies: [
                "L10n-swift",
            ],
            path: "Test"
        ),
    ]
)
$ swift package resolve
Updating https://github.com/Decybel07/L10n-swift.git
error: dependency graph is unresolvable; found these conflicting requirements:

Dependencies: 
    https://github.com/Decybel07/L10n-swift.git @ 5.5.1..<6.0.0

Environment.

L10n-swift version: 5.5.1

Xcode version: Xcode 10.3, Build version 10G8

Swift version: Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)

Platform(s):

Installation method:

Decybel07 commented 5 years ago

Thank you for reporting the problem. I will try to fix it as soon as possible.

Decybel07 commented 5 years ago

I solved the problem. SPM should work now. Unfortunately, due to the limitations of SPM, I can't attach the file Plural.stringsdict which is responsible for the correct plural form.

tcurdt commented 5 years ago

Thanks! That sound like good and bad news :) Could you elaborate on the Plural.stringsdict problem a bit?

Decybel07 commented 5 years ago

I use this file to find the right plural form for each language and region. Without this file my library will return form for "other" each time. I have no idea how I can attach this file using SPM.

tcurdt commented 5 years ago

OK - I guess that's the problem then https://bugs.swift.org/browse/SR-2866 :-/ https://forums.swift.org/t/swift-pm-bundles-and-resources/13981/34

tcurdt commented 4 years ago

Here is a propsal https://forums.swift.org/t/draft-proposal-package-resources/29941

Decybel07 commented 4 years ago

Here is a propsal https://forums.swift.org/t/draft-proposal-package-resources/29941

I will try to solve the problem as soon as possible https://forums.swift.org/t/accepted-with-modifications-se-0271-package-manager-resources/31021

ArmandsB commented 4 years ago

Any info about this? (as plural formatting not working :( )

Decybel07 commented 4 years ago

Now You can use plurals :)

 🎉  Congrats

 🚀  L10n-swift (5.6.1) successfully published
 📅  March 2nd, 20:08
 🌎  https://cocoapods.org/pods/L10n-swift