Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "NO">
allowLocationSimulation = "YES"
showNonLocalizedStrings = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand All @@ -124,7 +125,7 @@
</EnvironmentVariable>
</EnvironmentVariables>
<LocationScenarioReference
identifier = "London, England"
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
</LocationScenarioReference>
</LaunchAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ extension InvalidStorageViewController: ASTableDelegate, ASTableDataSource {
case .title:
return SetupTitleNode(
SetupTitleNode.Input(
title: "invalid_storage_text".localized
title: "invalid_storage_text"
.localized
.attributed(
.regular(16),
color: .mainTextColor,
Expand All @@ -111,11 +112,13 @@ extension InvalidStorageViewController: ASTableDelegate, ASTableDataSource {
case .button:
return ButtonCellNode(
input: ButtonCellNode.Input(
title: "invalid_storage_reset_button".localized.attributed(
.bold(16),
color: .white,
alignment: .center
),
title: "invalid_storage_reset_button"
.localized
.attributed(
.bold(16),
color: .white,
alignment: .center
),
color: .red
)
) { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension CheckMailAuthViewController {
node.delegate = self
node.dataSource = self

title = "FlowCrypt"
title = "app_name".localized
}
private func unauthStateNode(for indexPath: IndexPath) -> ASCellNode {
switch indexPath.row {
Expand Down
11 changes: 7 additions & 4 deletions FlowCrypt/Controllers/Compose/ComposeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ extension ComposeViewController {

private func enableGoogleContactsNode() -> ASCellNode {
TextWithIconNode(input: .init(
title: "compose_enable_google_contacts_search".localized.attributed(.regular(16)),
title: "compose_enable_google_contacts_search"
.localized
.attributed(.regular(16)),
image: UIImage(named: "gmail_icn"))
)
}
Expand Down Expand Up @@ -1211,7 +1213,8 @@ extension ComposeViewController: PHPickerViewControllerDelegate {
let url = url,
let composeMessageAttachment = MessageAttachment(fileURL: url)
else {
let message = isVideo ? "files_picking_videos_error_message".localized
let message = isVideo
? "files_picking_videos_error_message".localized
: "files_picking_photos_error_message".localized
let errorMessage = error.flatMap({ "." + $0.localizedDescription }) ?? ""
showAlert(message: message + errorMessage)
Expand Down Expand Up @@ -1318,7 +1321,7 @@ extension ComposeViewController {
preferredStyle: .alert
)
let okAction = UIAlertAction(
title: "OK",
title: "ok".localized,
style: .cancel
) { _ in }
let settingsAction = UIAlertAction(
Expand All @@ -1340,7 +1343,7 @@ extension ComposeViewController {
preferredStyle: .alert
)
let okAction = UIAlertAction(
title: "OK",
title: "ok".localized,
style: .cancel
) { _ in }
let settingsAction = UIAlertAction(
Expand Down
14 changes: 8 additions & 6 deletions FlowCrypt/Controllers/Compose/ComposeViewDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ struct ComposeViewDecorator {

func styledTextViewInput(with height: CGFloat, accessibilityIdentifier: String? = nil) -> TextViewCellNode.Input {
TextViewCellNode.Input(
placeholder: "message_compose_secure".localized.attributed(
.regular(17),
color: .lightGray,
alignment: .left
),
placeholder: "message_compose_secure"
.localized
.attributed(
.regular(17),
color: .lightGray,
alignment: .left
),
preferredHeight: height,
textColor: .mainTextColor,
accessibilityIdentifier: accessibilityIdentifier
Expand All @@ -40,7 +42,7 @@ struct ComposeViewDecorator {
accessibilityIdentifier: String? = nil
) -> TextFieldCellNode.Input {
TextFieldCellNode.Input(
placeholder: text.localized.attributed(
placeholder: text.attributed(
.regular(17),
color: .lightGray,
alignment: .left
Expand Down
2 changes: 1 addition & 1 deletion FlowCrypt/Controllers/Inbox/InboxViewDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct InboxViewDecorator {
func emptyStateNodeInput(for size: CGSize, title: String) -> TextCellNode.Input {
TextCellNode.Input(
backgroundColor: .backgroundColor,
title: "\(title) is empty",
title: title + " " + "empty".localized,
withSpinner: false,
size: size,
insets: UIEdgeInsets(
Expand Down
4 changes: 1 addition & 3 deletions FlowCrypt/Controllers/Search/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ extension SearchViewController {
// MARK: - MessageHandlerViewConroller
extension SearchViewController: MsgListViewController {

// TODO: - ANTON - check
func getUpdatedIndex(for message: InboxRenderable) -> Int? {
guard let message = message.wrappedMessage else {
return nil
Expand Down Expand Up @@ -243,8 +242,7 @@ extension SearchViewController: UISearchControllerDelegate, UISearchBarDelegate
}

private func update(searchController: UISearchController) {
searchController.searchBar.searchTextField
.attributedPlaceholder = "search_placeholder"
searchController.searchBar.searchTextField.attributedPlaceholder = "search_placeholder"
.localized
.attributed(
.regular(14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct BackupViewDecorator {

switch state {
case .idle:
title = "Fetching backups..."
title = "backup_screen_fetching_backups".localized
subtitle = ""
case let .backups(keys):
title = "backup_screen_found".localized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ struct ContactsListDecorator {
darkStyle: .lightGray,
lightStyle: .darkGray
)

let keysCount = "%@ public key(s)".localizeWithArguments(recipient.pubKeys.count)

let keysCount = "%@ public key(s)".localizePluralsWithArguments(recipient.pubKeys.count)
return ContactCellNode.Input(
name: name.attributed(.medium(16)),
email: recipient.email.attributed(.medium(14)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ extension SetupBackupsViewController {
try await self.recoverAccount(with: self.fetchedEncryptedKeys, and: passPhrase)
} catch {
hideSpinner()
showAlert(error: error, message: "Failed to set up account", onOk: {
// todo - what to do? maybe nothing, since they should now see the same button again that they can press again
})
showAlert(
error: error,
message: "error_setup_failed".localized,
onOk: {
// todo - what to do? maybe nothing, since they should now see the same button again that they can press again
})
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,14 @@ extension SetupCreatePassphraseAbstractViewController {
return await withCheckedContinuation { (continuation: CheckedContinuation<String?, Never>) in
DispatchQueue.main.async {
let alert = UIAlertController(
title: "Pass Phrase",
message: "Confirm Pass Phrase",
title: "setup_pass_phrase_title".localized,
message: "setup_pass_phrase_confirm".localized,
preferredStyle: .alert
)
alert.addTextField { textField in
textField.isSecureTextEntry = true
textField.accessibilityLabel = "textField"
}

alert.addAction(UIAlertAction(title: "cancel".localized, style: .default) { _ in
return continuation.resume(returning: nil)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class SetupEKMKeyViewController: SetupCreatePassphraseAbstractViewControll

let isErrorHandled = self.handleCommon(error: error)
if !isErrorHandled {
showAlert(error: error, message: "Could not finish setup, please try again")
showAlert(error: error, message: "error_setup_try_again".localized)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class SetupGenerateKeyViewController: SetupCreatePassphraseAbstractViewCon
let isErrorHandled = handleCommon(error: error)

if !isErrorHandled {
showAlert(error: error, message: "Could not finish setup, please try again")
showAlert(error: error, message: "error_setup_try_again".localized)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ extension SetupInitialViewController {
}
)
case .keysAreNotDecrypted:
showAlert(message: "organisational_rules_ekm_keys_are_not_decrypted_error".localized, onOk: { [weak self] in
self?.signOut()
})
showAlert(
message: "organisational_rules_ekm_keys_are_not_decrypted_error".localized,
onOk: { [weak self] in
self?.signOut()
}
)
}
} catch {
if case .noPrivateKeysUrlString = error as? EmailKeyManagerApiError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ extension SetupManuallyImportKeyViewController {
if privateKey.isEmpty {
userInfoMessage = "import_no_backups_clipboard".localized + user
} else {
userInfoMessage = "Found \(privateKey.count) key\(privateKey.count > 1 ? "s" : "")"
userInfoMessage = "Found %@ key(s)".localizePluralsWithArguments(privateKey.count)
proceedToPassPhrase(with: user, keys: privateKey)
}
}
Expand Down
4 changes: 2 additions & 2 deletions FlowCrypt/Controllers/Setup/SetupViewDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ struct SetupViewDecorator {

switch subtitleType {
case let .fetchedKeys(count):
subtitle = "Found \(count) key backup\(count > 1 ? "s" : "")"
subtitle = "Found %@ key backup(s)".localizePluralsWithArguments(count)
case let .fetchedEKMKeys(count):
subtitle = "Fetched %@ key(s) on EKM".localizeWithArguments(count)
subtitle = "Fetched %@ key(s) on EKM".localizePluralsWithArguments(count)
case .common:
subtitle = "setup_description".localized
case .choosingPassPhrase:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extension SetupImapViewController {
// MARK: - Setup
extension SetupImapViewController {
private func setupUI() {
title = "Email Provider"
title = "setup_providers".localized
observeKeyboardNotifications()
}

Expand Down Expand Up @@ -519,7 +519,7 @@ extension SetupImapViewController {
}

private func handleConnection(error: Error) {
showAlert(error: error, message: "Connection Error")
showAlert(error: error, message: "error_connection".localized)
}

private func handleSuccessfulConnection() {
Expand Down
22 changes: 11 additions & 11 deletions FlowCrypt/Controllers/SetupImap/SetupImapViewDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ struct SetupImapViewDecorator {
case let .account(part):
switch part {
case .email:
placeholder = "Email"
placeholder = "setup_imap_email".localized
keyboardType = .emailAddress
accessibilityIdentifier = "Email"
case .password:
placeholder = "Password"
placeholder = "setup_imap_password".localized
isSecure = true
accessibilityIdentifier = "Password"
case .username:
placeholder = "Username"
placeholder = "setup_imap_username".localized
case .title:
placeholder = nil
}
Expand All @@ -89,14 +89,14 @@ struct SetupImapViewDecorator {
case let .imap(part):
switch part {
case .port:
placeholder = "IMAP port"
placeholder = "setup_imap_port".localized
keyboardType = .numberPad
accessibilityIdentifier = "IMAP port"
case .security:
placeholder = "Security type"
placeholder = "setup_imap_security_type".localized
accessibilityIdentifier = "IMAP type"
case .server:
placeholder = "IMAP server"
placeholder = "setup_imap_server".localized
case .title:
placeholder = nil
}
Expand All @@ -105,14 +105,14 @@ struct SetupImapViewDecorator {
case let .smtp(part):
switch part {
case .port:
placeholder = "SMTP port"
placeholder = "setup_imap_smptp_port".localized
keyboardType = .numberPad
accessibilityIdentifier = "SMTP port"
case .security:
placeholder = "Security type"
placeholder = "setup_imap_security_type".localized
accessibilityIdentifier = "SMTP type"
case .server:
placeholder = "SMTP server"
placeholder = "setup_imap_smtp_server".localized
case .title:
placeholder = nil
}
Expand All @@ -121,10 +121,10 @@ struct SetupImapViewDecorator {
case let .other(part):
switch part {
case .name:
placeholder = "SMTP username"
placeholder = "setup_imap_smtp_username".localized
case .password:
isSecure = true
placeholder = "SMTP password"
placeholder = "setup_imap_smtp_password".localized
case .title:
placeholder = nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ extension FolderViewModel {
static var menuItems: [FolderViewModel] {
[
FolderViewModel(
name: "Settings",
name: "folder_settings".localized,
path: "",
image: UIImage(named: "settings")?.tinted(.mainTextColor),
itemType: .settings
),
FolderViewModel(
name: "Log out",
name: "log_out".localized,
path: "",
image: UIImage(named: "exit")?.tinted(.mainTextColor),
itemType: .logOut
Expand Down
12 changes: 8 additions & 4 deletions FlowCrypt/Controllers/Threads/AlertsFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ enum AlertsFactory {
alert.addTextField { tf in
tf.isSecureTextEntry = true
}

let saveAction = UIAlertAction(title: "Ok", style: .default) { _ in
let saveAction = UIAlertAction(
title: "ok".localized,
style: .default
) { _ in
guard let textField = alert.textFields?.first,
let passPhrase = textField.text,
passPhrase.isNotEmpty
Expand All @@ -41,8 +43,10 @@ enum AlertsFactory {
onCompletion(passPhrase)
}
}

let cancelAction = UIAlertAction(title: "Cancel", style: .destructive) { _ in
let cancelAction = UIAlertAction(
title: "cancel".localized,
style: .destructive
) { _ in
alert.dismiss(animated: true) {
onCancel()
}
Expand Down
Loading