Skip to content

Commit

Permalink
ISSUE-12 - Improved locale format handling to match RFC 5646
Browse files Browse the repository at this point in the history
- Bumped Lingo dependency to 4.0.0
  • Loading branch information
miroslavkovac committed Apr 6, 2022
1 parent f6f38c9 commit 6f9c6c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", from: "4.27.0"),
.package(url: "https://github.com/miroslavkovac/Lingo.git", from: "3.1.0")
.package(url: "https://github.com/miroslavkovac/Lingo.git", from: "4.0.0")
],
targets: [
.target(name: "LingoVapor", dependencies: [
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ Add LingoProvider as a dependancy in your `Package.swift` file:
```swift
dependencies: [
...,
.package(name: "LingoVapor", url: "https://github.com/vapor-community/lingo-vapor.git", from: "4.0.0")]
.package(name: "LingoVapor", url: "https://github.com/vapor-community/lingo-vapor.git", from: "4.2.0")]
],
targets: [
.target(name: "App", dependencies: [
.product(name: "LingoVapor", package: "LingoVapor")
```

### Upgrading from version 4.1.0 to version 4.2.0

The version 4.1.0 uses the new version of [Lingo](https://github.com/miroslavkovac/Lingo) where the format of locale identifiers was changed to match [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). Prior to 4.2.0 `_` was used to separate _language code_ and _country code_ in the locale identifier, and now the library uses `-` as per RFC.

If you were using any locales which include a country code, you would need to rename related translation files to match the new format.

### Add the Provider

In the `configure.swift` simply initialize the `LingoVapor` with a default locale:
Expand Down

0 comments on commit 6f9c6c0

Please sign in to comment.