Swiftpack.co - kkiermasz/InternationalizedVapor as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kkiermasz.
kkiermasz/InternationalizedVapor v1.2.0
Internationalizes your Vapor's HTTP requests
⭐️ 9
🕓 10 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/kkiermasz/InternationalizedVapor.git", from: "v1.2.0")

InternationalizedVapor

Internationalizes your Vapor's HTTP requests by wrapping the swift-foundation-icu.

Wrapper which provides NSFoundation-free Locale stands as a separate library.

Description

For example, a browser sends the web server the HTTP Accept-Language header indicating which locales, with a ranking, are acceptable to the user. The server must determine which locale to use when returning content to the user.

The negotiation result for ja;q=0.5, en-us;q=0.8, tlh will be en_US.

Usage example

app.get("hello") { req in 
    let locale = try req.locale 
    return response
}

Locale negotiation examples can be found here.

Installation

Swift Package Manager

Use Swift Package Manager by adding below dependency to your Package.swift file:

.package(url: "https://github.com/kkiermasz/InternationalizedVapor.git", from: "1.1.0")

License

InternationalizedVapor is shared under the MIT license. See both LICENSE and ICU4C's License for more info.

GitHub

link
Stars: 9
Last commit: 10 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v1.2.0
10 weeks ago

What's Changed

New Contributors

Full Changelog: https://github.com/kkiermasz/InternationalizedVapor/compare/v1.1.0...v1.2.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics