Reader and CloudKit Account Views

This commit is contained in:
Stuart Breckenridge
2022-12-16 16:38:06 +08:00
parent b3208bf269
commit 4ff0bc8f98
20 changed files with 554 additions and 149 deletions

View File

@@ -7,4 +7,11 @@
*/
"CANCEL_BUTTON_TITLE" = "Cancel";
"DISMISS_BUTTON_TITLE" = "Dismiss";
"DONE_BUTTON_TITLE" = "Done";
"REMOVE_ACCOUNT_BUTTON_TITLE" = "Remove Account";
"DEACTIVATE_BUTTON_TITLE" = "Deactivate";
"CREDENTIALS_BUTTON_TITLE" = "Credentials";
"ADD_ACCOUNT_BUTTON_TITLE" = "Add Account";
"UPDATE_CREDENTIALS_BUTTON_TITLE" = "Update Credentials";
"USE_CLOUDKIT_BUTTON_TITLE" = "Use iCloud";

View File

@@ -0,0 +1,12 @@
/*
Errors.strings
NetNewsWire
Created by Stuart Breckenridge on 16/12/2022.
Copyright © 2022 Ranchero Software. All rights reserved.
*/
"ERROR_TITLE" = "Error";
"DUPLICATE_ACCOUNT_ERROR" = "There is already an account of that type with that username created.";
"CLOUDKIT_NOT_ENABLED_ERROR" = "Unable to add iCloud Account. Please make sure you have iCloud and iCloud Drive enabled in System Settings.";

View File

@@ -0,0 +1,30 @@
//
// LocalizedNetNewsWireError.swift
// NetNewsWire
//
// Created by Stuart Breckenridge on 16/12/2022.
// Copyright © 2022 Ranchero Software. All rights reserved.
//
import Foundation
public enum LocalizedNetNewsWireError: LocalizedError {
/// Displayed when the user tries to create a duplicate
/// account with the same username.
case duplicateAccount
/// Displayed when the user attempts to add a
/// iCloud account but iCloud and/or iCloud Drive
/// are not enabled/
case iCloudDriveMissing
public var errorDescription: String? {
switch self {
case .duplicateAccount:
return Bundle.main.localizedString(forKey: "DUPLICATE_ACCOUNT_ERROR", value: nil, table: "Errors")
case .iCloudDriveMissing:
return Bundle.main.localizedString(forKey: "CLOUDKIT_NOT_ENABLED_ERROR", value: nil, table: "Errors")
}
}
}