Skip to content

Commit 31c4cb2

Browse files
Merge branch 'release/4.11.0' into versions
2 parents 8e12d83 + 7f79308 commit 31c4cb2

File tree

19 files changed

+173
-142
lines changed

19 files changed

+173
-142
lines changed

BartyCrouch.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "BartyCrouch"
4-
s.version = "4.10.0"
4+
s.version = "4.11.0"
55
s.summary = "Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files."
66

77
s.description = <<-DESC

CHANGELOG.md

Lines changed: 45 additions & 37 deletions
Large diffs are not rendered by default.

Formula/bartycrouch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Bartycrouch < Formula
22
desc "Incrementally update/translate your Strings files"
33
homepage "https://github.com/Flinesoft/BartyCrouch"
4-
url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.10.0", :revision => "0ab7e7eae5549439026676c730584846f1bc515a"
4+
url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.10.2", :revision => "8e12d831b2cb84c05c94a715815139e76f6a7b64"
55
head "https://github.com/Flinesoft/BartyCrouch.git"
66

77
depends_on :xcode => ["13.3", :build]

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<p align="center">
2-
<img src="https://raw.githubusercontent.com/Flinesoft/BartyCrouch/main/Logo.png" width=600>
2+
<img src="https://raw.githubusercontent.com/FlineDev/BartyCrouch/main/Logo.png" width=600>
33
</p>
44

55
<p align="center">
6-
<a href="https://github.com/Flinesoft/BartyCrouch/actions?query=workflow%3ACI+branch%3Amain">
7-
<img src="https://github.com/Flinesoft/BartyCrouch/workflows/CI/badge.svg?branch=main"
6+
<a href="https://github.com/FlineDev/BartyCrouch/actions?query=workflow%3ACI+branch%3Amain">
7+
<img src="https://github.com/FlineDev/BartyCrouch/workflows/CI/badge.svg?branch=main"
88
alt="CI Status">
99
</a>
10-
<a href="https://www.codacy.com/gh/Flinesoft/BartyCrouch">
10+
<a href="https://www.codacy.com/gh/FlineDev/BartyCrouch">
1111
<img src="https://api.codacy.com/project/badge/Grade/7b34ad9193c2438aa32aa29a0490451f"/>
1212
</a>
13-
<a href="https://www.codacy.com/gh/Flinesoft/BartyCrouch">
13+
<a href="https://www.codacy.com/gh/FlineDev/BartyCrouch">
1414
<img src="https://api.codacy.com/project/badge/Coverage/7b34ad9193c2438aa32aa29a0490451f"/>
1515
</a>
16-
<a href="https://github.com/Flinesoft/BartyCrouch/releases">
17-
<img src="https://img.shields.io/badge/Version-4.10.2-blue.svg"
18-
alt="Version: 4.10.2">
16+
<a href="https://github.com/FlineDev/BartyCrouch/releases">
17+
<img src="https://img.shields.io/badge/Version-4.11.0-blue.svg"
18+
alt="Version: 4.11.0">
1919
</a>
2020
<img src="https://img.shields.io/badge/Swift-5.6-FFAC45.svg"
2121
alt="Swift: 5.6">
22-
<a href="https://github.com/Flinesoft/BartyCrouch/blob/main/LICENSE.md">
22+
<a href="https://github.com/FlineDev/BartyCrouch/blob/main/LICENSE.md">
2323
<img src="https://img.shields.io/badge/License-MIT-lightgrey.svg"
2424
alt="License: MIT">
2525
</a>
@@ -45,7 +45,7 @@
4545
• <a href="#build-script">Build Script</a>
4646
• <a href="#donation">Donation</a>
4747
• <a href="#migration-guides">Migration Guides</a>
48-
• <a href="https://github.com/Flinesoft/BartyCrouch/issues">Issues</a>
48+
• <a href="https://github.com/FlineDev/BartyCrouch/issues">Issues</a>
4949
• <a href="#contributing">Contributing</a>
5050
• <a href="#license">License</a>
5151
</p>
@@ -87,7 +87,7 @@ brew upgrade bartycrouch
8787
To **install** or update to the latest version of BartyCrouch simply run this command:
8888

8989
```bash
90-
mint install Flinesoft/BartyCrouch
90+
mint install FlineDev/BartyCrouch
9191
```
9292
</details>
9393

@@ -154,7 +154,7 @@ This is the default configuration of BartyCrouch and should work for most projec
154154

155155
```swift
156156
// This file is required in order for the `transform` task of the translation helper tool BartyCrouch to work.
157-
// See here for more details: https://github.com/Flinesoft/BartyCrouch
157+
// See here for more details: https://github.com/FlineDev/BartyCrouch
158158

159159
import Foundation
160160

@@ -200,6 +200,7 @@ enum BartyCrouch {
200200
```toml
201201
[update.translate]
202202
paths = "."
203+
translator = "microsoftTranslator"
203204
secret = "<#Subscription Key#>"
204205
sourceLocale = "en"
205206
```
@@ -275,6 +276,7 @@ tasks = ["interfaces", "code", "transform", "normalize"]
275276
- `typeName`: The name of the type enclosing the `SupportedLanguage` enum and translate method.
276277
- `translateMethodName`: The name of the translate method to be replaced.
277278
- `customLocalizableName`: Use alternative name for `Localizable.strings`.
279+
- `separateWithEmptyLine`: Set to `false` if you don't want to have empty lines between Strings entries. Defaults to `true.
278280

279281
</details>
280282

@@ -285,6 +287,7 @@ tasks = ["interfaces", "code", "transform", "normalize"]
285287
- `translator`: Specifies the translation API. Use `microsoftTranslator` or `deepL`.
286288
- `secret`: Your [Microsoft Translator Text API Subscription Key](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/translator-text-how-to-signup#authentication-key) or [Authentication Key for DeepL API](https://www.deepl.com/pro-account/plan).
287289
- `sourceLocale`: The source language to translate from.
290+
- `separateWithEmptyLine`: Set to `false` if you don't want to have empty lines between Strings entries. Defaults to `true.
288291

289292
</details>
290293

@@ -295,6 +298,7 @@ tasks = ["interfaces", "code", "transform", "normalize"]
295298
- `sourceLocale`: The source language to harmonize keys of other languages with.
296299
- `harmonizeWithSource`: Synchronizes keys with source language.
297300
- `sortByKeys`: Alphabetically sorts translations by their keys.
301+
- `separateWithEmptyLine`: Set to `false` if you don't want to have empty lines between Strings entries. Defaults to `true.
298302

299303
</details>
300304

@@ -355,11 +359,13 @@ NOTE: As of version 4.x of BartyCrouch *formatted* localized Strings are not sup
355359
In order to truly profit from BartyCrouch's ability to update & lint your `.strings` files you can make it a natural part of your development workflow within Xcode. In order to do this select your target, choose the `Build Phases` tab and click the + button on the top left corner of that pane. Select `New Run Script Phase` and copy the following into the text box below the `Shell: /bin/sh` of your new run script phase:
356360

357361
```shell
362+
export PATH="$PATH:/opt/homebrew/bin"
363+
358364
if which bartycrouch > /dev/null; then
359365
bartycrouch update -x
360366
bartycrouch lint -x
361367
else
362-
echo "warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch"
368+
echo "warning: BartyCrouch not installed, download it from https://github.com/FlineDev/BartyCrouch"
363369
fi
364370
```
365371

@@ -404,21 +410,16 @@ func updateTimeLabel(minutes: Int) {
404410

405411
The `%d minute(s) ago` key will be taken from Localizable.stringsdict file, not from Localizable.strings, that's why it should be ignored by BartyCrouch.
406412

407-
### Things to Know:
408-
409-
- Files named or files in folders named ".git", "carthage", "pods", "build",
410-
".build" and "docs" (case insensitive) will always be ignored.
411-
412413

413414
## Donation
414415

415-
BartyCrouch was brought to you by [Cihat Gündüz](https://github.com/Jeehut) in his free time. If you want to thank me and support the development of this project, please **make a small donation on [PayPal](https://paypal.me/Dschee/5EUR)**. In case you also like my other [open source contributions](https://github.com/Flinesoft) and [articles](https://medium.com/@Jeehut), please consider motivating me by **becoming a sponsor on [GitHub](https://github.com/sponsors/Jeehut)** or a **patron on [Patreon](https://www.patreon.com/Jeehut)**.
416+
BartyCrouch was brought to you by [Cihat Gündüz](https://github.com/Jeehut) in his free time. If you want to thank me and support the development of this project, please **make a small donation on [PayPal](https://paypal.me/Dschee/5EUR)**. In case you also like my other [open source contributions](https://github.com/FlineDev) and [articles](https://medium.com/@Jeehut), please consider motivating me by **becoming a sponsor on [GitHub](https://github.com/sponsors/Jeehut)** or a **patron on [Patreon](https://www.patreon.com/Jeehut)**.
416417

417418
Thank you very much for any donation, it really helps out a lot! 💯
418419

419420
## Migration Guides
420421

421-
See the file [MIGRATION_GUIDES.md](https://github.com/Flinesoft/BartyCrouch/blob/main/MIGRATION_GUIDES.md).
422+
See the file [MIGRATION_GUIDES.md](https://github.com/FlineDev/BartyCrouch/blob/main/MIGRATION_GUIDES.md).
422423

423424
## Contributing
424425

Sources/BartyCrouch/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwiftCLI
55
// MARK: - CLI
66
let cli = CLI(
77
name: "bartycrouch",
8-
version: "4.10.2",
8+
version: "4.11.0",
99
description: "Incrementally update & translate your Strings files from code or interface files."
1010
)
1111

Sources/BartyCrouchConfiguration/Options/UpdateOptions/NormalizeOptions.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public struct NormalizeOptions {
88
public let sourceLocale: String
99
public let harmonizeWithSource: Bool
1010
public let sortByKeys: Bool
11+
public let separateWithEmptyLine: Bool
1112
}
1213

1314
extension NormalizeOptions: TomlCodable {
@@ -20,18 +21,20 @@ extension NormalizeOptions: TomlCodable {
2021
subpathsToIgnore: toml.array(update, normalize, "subpathsToIgnore") ?? Constants.defaultSubpathsToIgnore,
2122
sourceLocale: toml.string(update, normalize, "sourceLocale") ?? "en",
2223
harmonizeWithSource: toml.bool(update, normalize, "harmonizeWithSource") ?? true,
23-
sortByKeys: toml.bool(update, normalize, "sortByKeys") ?? true
24+
sortByKeys: toml.bool(update, normalize, "sortByKeys") ?? true,
25+
separateWithEmptyLine: toml.bool(update, normalize, "separateWithEmptyLine") ?? true
2426
)
2527
}
2628

2729
func tomlContents() -> String {
2830
var lines: [String] = ["[update.normalize]"]
2931

30-
lines.append("paths = \(paths)")
31-
lines.append("subpathsToIgnore = \(subpathsToIgnore)")
32-
lines.append("sourceLocale = \"\(sourceLocale)\"")
33-
lines.append("harmonizeWithSource = \(harmonizeWithSource)")
34-
lines.append("sortByKeys = \(sortByKeys)")
32+
lines.append("paths = \(self.paths)")
33+
lines.append("subpathsToIgnore = \(self.subpathsToIgnore)")
34+
lines.append("sourceLocale = \"\(self.sourceLocale)\"")
35+
lines.append("harmonizeWithSource = \(self.harmonizeWithSource)")
36+
lines.append("sortByKeys = \(self.sortByKeys)")
37+
lines.append("separateWithEmptyLine = \(self.separateWithEmptyLine)")
3538

3639
return lines.joined(separator: "\n")
3740
}

Sources/BartyCrouchConfiguration/Options/UpdateOptions/TransformOptions.swift

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public struct TransformOptions {
1212
public let typeName: String
1313
public let translateMethodName: String
1414
public let customLocalizableName: String?
15+
public let separateWithEmptyLine: Bool
1516
}
1617

1718
extension TransformOptions: TomlCodable {
@@ -43,25 +44,28 @@ extension TransformOptions: TomlCodable {
4344
supportedLanguageEnumPath: toml.string(update, transform, "supportedLanguageEnumPath") ?? ".",
4445
typeName: toml.string(update, transform, "typeName") ?? "BartyCrouch",
4546
translateMethodName: toml.string(update, transform, "translateMethodName") ?? "translate",
46-
customLocalizableName: toml.string(update, transform, "customLocalizableName")
47+
customLocalizableName: toml.string(update, transform, "customLocalizableName"),
48+
separateWithEmptyLine: toml.bool(update, transform, "separateWithEmptyLine") ?? true
4749
)
4850
}
4951

5052
func tomlContents() -> String {
5153
var lines: [String] = ["[update.transform]"]
5254

53-
lines.append("codePaths = \(codePaths)")
54-
lines.append("subpathsToIgnore = \(subpathsToIgnore)")
55-
lines.append("localizablePaths = \(localizablePaths)")
56-
lines.append("transformer = \"\(transformer.rawValue)\"")
57-
lines.append("supportedLanguageEnumPath = \"\(supportedLanguageEnumPath)\"")
58-
lines.append("typeName = \"\(typeName)\"")
59-
lines.append("translateMethodName = \"\(translateMethodName)\"")
55+
lines.append("codePaths = \(self.codePaths)")
56+
lines.append("subpathsToIgnore = \(self.subpathsToIgnore)")
57+
lines.append("localizablePaths = \(self.localizablePaths)")
58+
lines.append(#"transformer = "\#(self.transformer.rawValue)""#)
59+
lines.append(#"supportedLanguageEnumPath = "\#(self.supportedLanguageEnumPath)""#)
60+
lines.append(#"typeName = "\#(self.typeName)""#)
61+
lines.append(#"translateMethodName = "\#(self.translateMethodName)""#)
6062

6163
if let customLocalizableName = customLocalizableName {
62-
lines.append("customLocalizableName = \"\(customLocalizableName)\"")
64+
lines.append(#"customLocalizableName = "\#(customLocalizableName)""#)
6365
}
6466

67+
lines.append("separateWithEmptyLine = \(self.separateWithEmptyLine)")
68+
6569
return lines.joined(separator: "\n")
6670
}
6771
}

Sources/BartyCrouchConfiguration/Options/UpdateOptions/TranslateOptions.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public struct TranslateOptions {
1313
public let subpathsToIgnore: [String]
1414
public let secret: Secret
1515
public let sourceLocale: String
16+
public let separateWithEmptyLine: Bool
1617
}
1718

1819
extension TranslateOptions: TomlCodable {
@@ -21,10 +22,11 @@ extension TranslateOptions: TomlCodable {
2122
let translate: String = "translate"
2223

2324
if let secretString: String = toml.string(update, translate, "secret") {
24-
let translator = toml.string(update, translate, "translator") ?? ""
25+
let translator = toml.string(update, translate, "translator") ?? "microsoftTranslator"
2526
let paths = toml.filePaths(update, translate, singularKey: "path", pluralKey: "paths")
2627
let subpathsToIgnore = toml.array(update, translate, "subpathsToIgnore") ?? Constants.defaultSubpathsToIgnore
2728
let sourceLocale: String = toml.string(update, translate, "sourceLocale") ?? "en"
29+
let separateWithEmptyLine = toml.bool(update, translate, "separateWithEmptyLine") ?? true
2830
let secret: Secret
2931
switch Translator(rawValue: translator) {
3032
case .microsoftTranslator, .none:
@@ -38,7 +40,8 @@ extension TranslateOptions: TomlCodable {
3840
paths: paths,
3941
subpathsToIgnore: subpathsToIgnore,
4042
secret: secret,
41-
sourceLocale: sourceLocale
43+
sourceLocale: sourceLocale,
44+
separateWithEmptyLine: separateWithEmptyLine
4245
)
4346
}
4447
else {
@@ -56,13 +59,14 @@ extension TranslateOptions: TomlCodable {
5659
lines.append("subpathsToIgnore = \(subpathsToIgnore)")
5760
switch secret {
5861
case let .deepL(secret):
59-
lines.append("secret = \"\(secret)\"")
62+
lines.append(#"secret = "\#(secret)""#)
6063

6164
case let .microsoftTranslator(secret):
62-
lines.append("secret = \"\(secret)\"")
65+
lines.append(#"secret = "\#(secret)""#)
6366
}
6467

65-
lines.append("sourceLocale = \"\(sourceLocale)\"")
68+
lines.append(#"sourceLocale = "\#(sourceLocale)""#)
69+
lines.append("separateWithEmptyLine = \(self.separateWithEmptyLine)")
6670

6771
return lines.joined(separator: "\n")
6872
}

0 commit comments

Comments
 (0)