-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set minimum macOS version to version 10.15 (Catalina) * Add MissingTranslation struct * Add concurrency to core functionality * Adopt AsyncParsableCommand protocol to provide an asynchronous entry point * Add XCTest extension for testing async throwing expressions * Add concurrency to tests
- Loading branch information
1 parent
59968c2
commit afeff86
Showing
6 changed files
with
261 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
struct MissingTranslation { | ||
enum Category { | ||
case deviceMissingOrNotTranslated(forDevice: String, inLanguage: String) | ||
case missingOrNotTranslated(inLanguage: String) | ||
case missingTranslation(forLanguage: String) | ||
case missingTranslationForAllLanguages | ||
case pluralMissingOrNotTranslated(forPluralForm: String, inLanguage: String) | ||
} | ||
|
||
let category: Category | ||
let filePath: String | ||
let originalString: String | ||
} | ||
|
||
extension MissingTranslation { | ||
var message: String { | ||
switch category { | ||
case let .deviceMissingOrNotTranslated(device, language): | ||
return "'\(originalString)' device '\(device)' is missing or not translated in '\(language)' in file: \(filePath)" | ||
case let .missingOrNotTranslated(language): | ||
return "'\(originalString)' is missing or not translated in '\(language)' in file: \(filePath)" | ||
case let .missingTranslation(language): | ||
return "'\(originalString)' is missing translations for language '\(language)' in file: \(filePath)" | ||
case .missingTranslationForAllLanguages: | ||
return "'\(originalString)' is not translated in any language in file: \(filePath)" | ||
case let .pluralMissingOrNotTranslated(pluralForm, language): | ||
return "'\(originalString)' plural form '\(pluralForm)' is missing or not translated in '\(language)' in file: \(filePath)" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.