Skip to content

Commit

Permalink
Merge branch 'release/4.6.0' into versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed May 8, 2021
2 parents 34ca469 + c3b0ecd commit 771a4ae
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 28 deletions.
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ opt_in_rules:
- quick_discouraged_focused_test
- quick_discouraged_pending_test
- redundant_nil_coalescing
- redundant_type_annotation
- single_test_class
- sorted_first_last
- sorted_imports
Expand Down
2 changes: 1 addition & 1 deletion BartyCrouch.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "BartyCrouch"
s.version = "4.5.0"
s.version = "4.6.0"
s.summary = "Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files."

s.description = <<-DESC
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se
### Security
- None.

## [4.6.0] - 2021-05-08
### Changed
- Updated swift-syntax to match Swift 5.4 to support Xcode 12.5.
Issues: [#222](https://github.com/Flinesoft/BartyCrouch/issues/222) | PR: [#223](https://github.com/Flinesoft/BartyCrouch/pull/223) | Author: [Matt Sanford](https://github.com/mzsanford)

## [4.5.0] - 2021-02-21
### Added
- Add support for DeepL API as an alternative for Microsoft Translator API.
Expand Down
2 changes: 1 addition & 1 deletion Formula/bartycrouch.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Bartycrouch < Formula
desc "Incrementally update/translate your Strings files"
homepage "https://github.com/Flinesoft/BartyCrouch"
url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.4.1", :revision => "d0ea3568044e2348e5fa87b9fdbc9254561039e2"
url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.5.0", :revision => "34ca469548e5ed8c39ddc394683b5cfcd510d866"
head "https://github.com/Flinesoft/BartyCrouch.git"

depends_on :xcode => ["12.0", :build]
Expand Down
10 changes: 5 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"repositoryURL": "https://github.com/Flinesoft/HandySwift.git",
"state": {
"branch": null,
"revision": "4f1f96beb8a4c45b01a2479d8cbaf91bda7d1cb5",
"version": "3.2.1"
"revision": "50b84f0fa735cae0e2bc3155609d4b00e2ce854c",
"version": "3.3.0"
}
},
{
"package": "Microya",
"repositoryURL": "https://github.com/Flinesoft/Microya.git",
"state": {
"branch": "main",
"revision": "29eb0d6fd650e99f33d26aaea44d18a042731ac5",
"revision": "fa994e12c0c0a383c66cb7fd644b9ec6ee534bf9",
"version": null
}
},
Expand All @@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/apple/swift-syntax.git",
"state": {
"branch": null,
"revision": "844574d683f53d0737a9c6d706c3ef31ed2955eb",
"version": "0.50300.0"
"revision": "2fff9fc25cdc059379b6bd309377cfab45d8520c",
"version": "0.50400.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
.package(name: "Rainbow", url: "https://github.com/onevcat/Rainbow.git", from: "3.1.5"),
.package(name: "SwiftCLI", url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.1"),
.package(name: "Toml", url: "https://github.com/jdfergason/swift-toml.git", .branch("master")),
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .exact("0.50300.0")),
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", from: "0.50400.0")
],
targets: [
.target(
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<img src="https://api.codacy.com/project/badge/Coverage/7b34ad9193c2438aa32aa29a0490451f"/>
</a>
<a href="https://github.com/Flinesoft/BartyCrouch/releases">
<img src="https://img.shields.io/badge/Version-4.5.0-blue.svg"
alt="Version: 4.5.0">
<img src="https://img.shields.io/badge/Version-4.6.0-blue.svg"
alt="Version: 4.6.0">
</a>
<img src="https://img.shields.io/badge/Swift-5.3-FFAC45.svg"
alt="Swift: 5.3">
<img src="https://img.shields.io/badge/Swift-5.4-FFAC45.svg"
alt="Swift: 5.4">
<a href="https://github.com/Flinesoft/BartyCrouch/blob/main/LICENSE.md">
<img src="https://img.shields.io/badge/License-MIT-lightgrey.svg"
alt="License: MIT">
Expand Down Expand Up @@ -58,7 +58,7 @@ Checkout [this blog post](https://medium.com/@Jeehut/localization-in-swift-like-

## Requirements

- Xcode 11.4+ & Swift 5.2+
- Xcode 12.5+ & Swift 5.4+
- Xcode Command Line Tools (see [here](http://stackoverflow.com/a/9329325/3451975) for installation instructions)

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion Sources/BartyCrouch/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SwiftCLI
// MARK: - CLI
let cli = CLI(
name: "bartycrouch",
version: "4.5.0",
version: "4.6.0",
description: "Incrementally update & translate your Strings files from code or interface files."
)

Expand Down
4 changes: 2 additions & 2 deletions Sources/BartyCrouchTranslator/BartyCrouchTranslator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public final class BartyCrouchTranslator {
case deepL(apiKey: String)
}

private let microsoftProvider = ApiProvider<MicrosoftTranslatorApi>()
private let deepLProvider = ApiProvider<DeepLApi>()
private let microsoftProvider = ApiProvider<MicrosoftTranslatorApi>(baseUrl: MicrosoftTranslatorApi.baseUrl)
private let deepLProvider = ApiProvider<DeepLApi>(baseUrl: DeepLApi.baseUrl)

private let translationService: TranslationService

Expand Down
8 changes: 4 additions & 4 deletions Sources/BartyCrouchTranslator/DeeplApi/DeepLApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ enum DeepLApi {
extension DeepLApi: Endpoint {
typealias ClientErrorType = DeepLTranslateErrorResponse

static var baseUrl: URL {
URL(string: "https://api.deepl.com")!
}

var decoder: JSONDecoder {
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
Expand All @@ -43,10 +47,6 @@ extension DeepLApi: Endpoint {
JSONEncoder()
}

var baseUrl: URL {
URL(string: "https://api.deepl.com")!
}

var subpath: String {
switch self {
case .translate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ enum MicrosoftTranslatorApi {
extension MicrosoftTranslatorApi: Endpoint {
typealias ClientErrorType = EmptyBodyResponse

static var baseUrl: URL {
return URL(string: "https://api.cognitive.microsofttranslator.com")!
}

var decoder: JSONDecoder {
return JSONDecoder()
}
Expand All @@ -41,10 +45,6 @@ extension MicrosoftTranslatorApi: Endpoint {
return JSONEncoder()
}

var baseUrl: URL {
return URL(string: "https://api.cognitive.microsofttranslator.com")!
}

var subpath: String {
switch self {
case .translate:
Expand Down
2 changes: 1 addition & 1 deletion Sources/SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.5.0</string>
<string>4.6.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DeepLTranslatorApiTests: XCTestCase {
apiKey: apiKey
)

let apiProvider = ApiProvider<DeepLApi>()
let apiProvider = ApiProvider<DeepLApi>(baseUrl: DeepLApi.baseUrl)

switch apiProvider.performRequestAndWait(on: endpoint, decodeBodyTo: DeepLTranslateResponse.self) {
case let .success(translateResponses):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MicrosoftTranslatorApiTests: XCTestCase {
microsoftSubscriptionKey: microsoftSubscriptionKey
)

let apiProvider = ApiProvider<MicrosoftTranslatorApi>()
let apiProvider = ApiProvider<MicrosoftTranslatorApi>(baseUrl: MicrosoftTranslatorApi.baseUrl)

switch apiProvider.performRequestAndWait(on: endpoint, decodeBodyTo: [TranslateResponse].self) {
case let .success(translateResponses):
Expand Down

0 comments on commit 771a4ae

Please sign in to comment.